Overview | Statement List | Example 1 | Example 2 | Example 3 | Example 4


Âß¼­IF

Synopsis

IF/logical expression,statement

Description

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
- Subtraction
* Multiplication
/ Division
** Exponentiation

Second

Logical Operators:

== Equal to
<> Not equal to
< Less than
<= Less than or equal
to
>= Greater than or
equal to

Third

Boolean Operator:

NOT Complement

Fourth

Boolean Operators:

AND Both
OR Either

Parameters

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).

NOTE: EDAs are not allowed in logical expression.

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:
A=1
DELETE/LN1

Exceptions are: DO and DECLARATION statements.


Copyright ©2015 ºú¾ýNX¶þ´Î¿ª·¢¹ÙÍø£¨www.UGapi.com£© QQ:85585969 All Rights Reserved.