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 | Example |
if bool_expr statements ... elseif bool_expr statements ... elseif bool_expr statements ... else statements ... endif |
if value = 10 writeln "Value is a round 10"; elseif value < 5 writeln "Value as less than 5"; elseif value = 100 writeln "Value is exactly 100"; else writeln "Value is boring"; endif |