Warning

You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
ifthenelse [2019/06/09 08:26] – [Performance tip] neilsifthenelse [2019/07/15 10:16] neils
Line 3: Line 3:
 Syntax: Syntax:
  
- if <any relation> [and | or <any relation>] then <statements> [else <statements>]+  if <any relation> [and | or <any relation>] then <statements> [else <statements>]
   
 +or, since version 2.1:
 +
 +  if <any relation> [and | or <any relation>] then
 +    <statements>
 +  [else
 +    <statements>]
 +  endif
 +
 Conditional structure. Executes the statements after ''THEN'' if the expression evaluates to true, otherwise the statements after ''ELSE'', if present. ''ELSE'' is optional. Conditional structure. Executes the statements after ''THEN'' if the expression evaluates to true, otherwise the statements after ''ELSE'', if present. ''ELSE'' is optional.
  
Line 36: Line 44:
 ====== Performance tip ====== ====== Performance tip ======
  
-An ''ON ... GOTO'' or ''ON ... GOSUB'' construct is faster than its ''IF ... THEN GOTO/GOSUB'' equivalent. Please refer to the [[ON|ON command]] for details.+An ''ON ... GOTO'' or ''ON ... GOSUB'' construct is faster than its ''IF ... THEN GOTO/GOSUB'' equivalent. Please refer to the [[ON|ON construct]] for details.