Parent Topic: Language

IF

The syntax for the possible IF ... EXTRIF ... ELSE ... ENDIF constructs are shown below:

 IF cond THEN               IF cond THEN             IF cond THEN
   statement;                statement;                statement;
      ...                       ...                       ...
   statement;                statement;                statement;
 EXTRIF cond THEN           ELSE                     ENDIF;
   statement;                statement;
      ...                       ...
   statement;                statement;
 ELSE                       ENDIF;
   statement;
      ...
   statement;
 ENDIF;
`statement' can be an ASSIGNMENT, GOTO, LABEL, STOP or another IF statement.

`cond' is a condition made up of a series of logical expressions joined by logical operators. This has the syntax:

   (exp relopr exp) logopr (exp relopr exp) ...
Where:

   exp          is an arithmetic or character expression

   relopr       is a relational operator

   logopr       is a logical operator
The following relational operators are available and will work on either arithmetic or character expressions:

   =            equals
   >            greater than
   <            less than
   >=           greater than or equal
   <=           less than or equal
   <>           not equal
The following logical operators are available:

   and
   or
Example:

   if (%tree.2 = "spruce") and (%rain > 10) then
      %result = 5;
   else
      %result = %rain / 3;
   endif;

Parent Topic: Language
About PCI Help Gateway