Vbscript-logical-operators
提供:Dev Guides
VBScript論理演算子
VBScriptは次の論理演算子をサポートしています-
変数Aが10を保持し、変数Bが0を保持すると仮定します-
Operator | Description | Example |
---|---|---|
AND | Called Logical AND operator. If both the conditions are True, then Expression becomes True. | a<>0 AND b<>0 is False. |
OR | Called Logical OR Operator. If any of the two conditions is True, then condition becomes True. | a<>0 OR b<>0 is true. |
NOT | Called Logical NOT Operator. It reverses the logical state of its operand. If a condition is True, then the Logical NOT operator will make it False. | NOT(a<>0 OR b<>0) is false. |
XOR | Called Logical Exclusion. It is the combination of NOT and OR Operator. If one, and only one, of the expressions evaluates to True, result is True. | (a<>0 XOR b<>0) is true. |
例
VBScriptで利用可能なすべての論理演算子を理解するために、次の例を試してください-
lとして保存してInternet Explorerで実行すると、上記のスクリプトは次の結果を生成します-