Actions

Difference between revisions of "IF/ENDIF"

From Zenitel Wiki

 
(7 intermediate revisions by 4 users not shown)
Line 1: Line 1:
The '''IF'''  and '''ENDIF''' statements are used in the [[Event Handler]]. If the text/expression following the IF evaluates to the number zero, or no text at all, the following statements are skipped until a (matching) ENDIF is found.
+
{{AI}}
 +
The '''IF'''  and '''ENDIF''' statements are used in the [[Event Handler]]. If the expression following the IF evaluates to the number zero, the following statements are skipped until a (matching) ENDIF is found. The IF statement can test numeric values only.
  
IF - ENDIF statements can be nested
+
The IF - ENDIF statements can be nested.
  
The statement [[STOP]] stops the execution of the action string. Is only useful in front of an ENDIF
+
The statement [[STOP]] stops the execution of the action string.
  
 
Example:
 
Example:
 +
 +
{{code2|
 
  IF %udd(1)
 
  IF %udd(1)
  LOG “Variable 1 is true”
+
  LOG “Variable 1 is true”
  STOP
+
  STOP
 
  ENDIF
 
  ENDIF
  LOG “Variable 1 is false”
+
  LOG “Variable 1 is false”}}
  
  

Latest revision as of 10:43, 31 May 2022

AI.png

The IF and ENDIF statements are used in the Event Handler. If the expression following the IF evaluates to the number zero, the following statements are skipped until a (matching) ENDIF is found. The IF statement can test numeric values only.

The IF - ENDIF statements can be nested.

The statement STOP stops the execution of the action string.

Example:

Action commands:

IF %udd(1)
 LOG “Variable 1 is true”
 STOP
ENDIF
LOG “Variable 1 is false”