Autoit 为什么 (0 <> "Test") 为假

Autoit Why is (0 <> "Test") False

我正在从 HTML table 中获取数值。如果它无法获取值,我将改为填充值 "NA"。这里是奇数部分 0 <> "NA" 为假,0 = "NA" 为真,0 == "NA" 为假。我知道 = 不区分大小写,而 == 是,但我认为 <> 区分大小写...那么为什么它会这样工作?

Local $x = 0
If $x <> "Test" Then
    MsgBox(0,"","x <> Test")
Else
    MsgBox(0,"","x = Test")
EndIf

有了这个例子,我得到了一个消息框 "x = Test"

but I thought <> was case sensitive

根据the docs,它不是像==那样的特定于字符串的比较运算符。相反,它只是 = 的否定,因此您的字符串仍将被解释为整数 – "NA""Test" 都变成 0 – 并且无法满足 0 <> 0.

Tests if two values are not equal. Case insensitive when used with strings. To do a case sensitive not equal comparison use Not ("string1" == "string2")