当两个参数的值相同或都为空时,操作符==返回 TRUE,此运算符不执行字符串和数字之间的任何隐式转换,也就是说,将空值(BLANK)与任何其他值比较,比如 0、空字符串等,都将返回 FALSE。
只有当两个术语中至少有一个为空、空字符串或 0 时,==运算才与=不同。以下是使用“严格等于”运算符的有效表达式:
Product[Color] == "Red" Product[Color] == BLANK() -- Product[Color] 为 BLANK 时返回 TRUE, 为 "" 或其他值时返回 FALSE Product[Color] == "" -- Product[Color] 为空字符串时返回 TRUE, 为 BLANK 或其他值时返回 FALSE Sales[Quantity] == 1 Sales[Quantity] == BLANK() -- Sales[Quantity] 为 BLANK 时返回 TRUE, 为 "" 或其他值时返回 FALSE Sales[Quantity] == 0 -- Sales[Quantity] 为 0 时返回 TRUE, 为 BLANK 或其他值时返回 FALSE
扩展阅读:
说点什么