Const If…Else Statement

Lets you compile some code and ignore other code for different conditions.

Syntax

Const If condition [ Then ]
    [ statements ]
[ Else If else_if_condition [ Then ]
    [ else_if_statements ] ]
…
[ Else
    [ else_statements ] ]
End [ If ]

Parts

condition
Mandatory Boolean expression.
statements
Optional one or more statements, compiled only if condition is true.
Else If
Optional keywords that you can use again and again.
else_if_condition
Mandatory after Else If, a Boolean expression calculated only when condition (or else_if_condition before this one) is false.
else_if_statements
Optional one or more statements, compiled only when elseif_condition is true.
else_statements
Optional one or more statements, compiled only when condition and all of else_if_condition(s) are false.
End
Completes the statement. You can also use End If.

Instructions

TODO

Examples

Const If Debug Then
    Const timeout = 60
Else
    Const timeout = 600
End If

See also