Statement: if
An if statement allows one or more statements to be run, depending on a given condition.
The statement may include zero or more 'elseif condition' sub-statements and an optional 'else' sub-statement. The statement must end with the endif keyword.
if Statement Format |
---|
if bool_expr statements ... elseif bool_expr statements ... elseif bool_expr statements ... else statements ... endif |
Example |
---|
if value = 10 write "Value is a round 10" nl; elseif value < 5 write "Value as less than 5" nl; elseif value = 100 write "Value is exactly 100" nl; else write "Value is boring" nl; endif |