IF expression THEN ... ELSE ... ENDIF IF expression THEN ... ELSEIF expression2 THEN ... ... ELSE ... ENDIF
Implement a conditional jump. This implementation assumes that
an expression passed as a parameter is 0 (for false) and not
zero (for true). In this case, if the expression is zero, it
jumps directly to the statement following the corresponding
ENDIF
(or ELSE
, if present). Otherwise, the following
code will be executed (up to ENDIF
or ELSE
).
IF ( x == 42 ) THEN : x = 0 : ELSE : x = 1 : ENDIF IF ( x == 42 ) THEN : x = 0 : ELSE IF y == 0 THEN : y = 42 : ELSE : x = 1 : ENDIF IF ( x == 42 ) THEN x = 0 ELSE IF y == 0 THEN y = 42 ELSE x = 1 ENDIF
See also the following example files:
If...Th...El...Eif...Ei
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please open an issue for this keyword on GitHub. Thank you!