Overview | Statement List | Example 1 | Example 2 | Example 3 | Example 4
IF/logical expression,statement
This statement provides for the execution or exclusion of a statement based on the results of a logical expression. If the results of the logical comparison is true, for example: does 1 equal 1, IF/1==1, the following statement is executed. If the results of the logical comparison is false, for example: does 1 equal 2, IF/1==2, the following statement is not executed.
The order of evaluation for the arithmetic and logical operators is important in obtaining the desired results.
Order |
Operator |
First |
Arithmetic Operators: + Addition |
Second |
Logical Operators: == Equal to |
Third |
Boolean Operator: NOT Complement |
Fourth |
Boolean Operators: AND Both |
Parameter |
Description |
logical expression |
A logical expression which consists of two values separated by a logical operator. The expression may consist of any combination of constants and numerical variables or any combination of string literals and string variables. The following table is a list of logical operators which perform the comparisons (the symbols < and > represent the less than and greater than symbols respectively).
|
Operator |
Comparison |
== |
Equal to |
<> |
Not equal to |
< |
Less than |
<= |
Less than or equal to |
> |
Greater than |
>= |
Greater than or equal to |
statement |
Any executable GRIP statement such as: JUMP/label: Exceptions are: DO and DECLARATION statements. |