VBS教程:运算符-And 运算符
发布时间:2016-12-28 来源:查字典编辑
摘要:And运算符对两个表达式进行逻辑“与”运算。result=expression1Andexpression2参数result任意数值变量。e...
And 运算符
对两个表达式进行逻辑“与”运算。
result = expression1
And expression2
参数
result
任意数值变量。
expression1
任意表达式。
expression2
任意表达式。
说明
当且仅当两个表达式均为
True,则
result 为
True。如果任一表达式为
False,则
result 为
False。下表说明如何确定
result:
True | True | True |
True | False | False |
True | Null | Null |
False | True | False |
False | False | False |
False | Null | False |
Null | True | Null |
Null | False | False |
Null | Null | Null |
And 运算符还对两个数值表达式中位置相同的位执行逐位比较,并根据下表设置
result 中相应的位:
0 | 0 | 0 |
0 | 1 | 0 |
1 | 0 | 0 |
1 | 1 | 1 |