Value > Basic Data Values > BooleanClass Values |
The BooleanClass class defines the characteristics of values that can only have one of two states.
true false on --equivalent to true off --equivalent to false "true" as booleanClass "false" as booleanClass "on" as booleanClass "off" as booleanClass
true if boolean= false , false if boolean= true
true if both boolean values are true
true if either boolean value is true
The boolean and and or evaluations are non-strict. This means that only the first boolean might be evaluated to determine the overall result:
If the first operand is false in an and expression, the result must be false, so the second operand is not evaluated.
If the first operand is true in an or expression, the result must be true , so the second operand is not evaluated.
This saves execution time and enables useful shorthand notation. For example, if you want to calculate 'sin a' and if the value of variable 'a' is not undefined , you can use the example below:
The following script shows the use of various literals and operators of the BooleanClass class.