Vbscript-comparison-operators
提供:Dev Guides
VBScriptの比較演算子
次の表は、VBScript言語でサポートされているすべての比較演算子を示しています。 変数Aが10を保持し、変数Bが20を保持すると仮定すると:
Operator | Description | Example |
---|---|---|
= | Checks if the value of two operands are equal or not, if yes then condition becomes true. | (A == B) is False. |
<> | Checks if the value of two operands are equal or not, if values are not equal then condition becomes true. | (A <> B) is True. |
> | Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. | (A > B) is False. |
< | Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. | (A < B) is True. |
>= | Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. | (A >= B) is False. |
⇐ | Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. | (A ⇐ B) is True. |
例
VBScriptで利用可能なすべての比較演算子を理解するには、次の例を試してください。
lとして保存してInternet Explorerで実行すると、上記のスクリプトは次の結果を生成します。