我在AutoIt(v3.3.8.1)中写了这段代码。
$x = 'dog'
if not $x = 'hello' Then
ConsoleWrite("fish")
Else
ConsoleWrite("world")
EndIf
你不觉得输出应该是 "鱼 "吗?但它却说 "世界"。怎么了?
这是因为 操作者优先. 与其他语言,如BASIC和Perl相反,在AutoIt中。not
具有比平等更高的优先权。将代码改为
if not ($x = 'hello') then
或
if $x <> 'hello' then