If : Else : EndIf


Syntax
If <expression> 
  ...
[ElseIf <expression>]
  ...
[Else]
  ...
EndIf 
Description
The If structure is used to achieve tests, and/or change the programmes direction, if the test is true or false. ElseIf can be used to do any number of additionnal test if the previous one was not true. The Else optional command is used to execute a part of code, if all previous tests were false. Any number of If structures can be nested together.

Example:

  If a=10 
    Debug "a=10"
  Else
    Debug "a<>10"
  EndIf    

Example:

  If a=10 And b>=10 Or c=20     
    If b=15
      Debug "b=15"
    Else       
      Debug "Other possibility"
    EndIf   
  Else     
    Debug "Test failure"
  EndIf