if
The if
statement in SIMPOL is similar to that in most
languages. There are some differences with the IF
statement
from SBL, specifically that there is no THEN
component and
also no concept of a one-line IF
statement that does not
require an END IF
statement. In SIMPOL every
if
statement requires a matching
end if
statement. Otherwise the if
statement
is equivalent to that in SBL and in other BASIC-derived languages. There is
also an else if
statement and an else
statement
as optional parts of the if
statement. The syntax diagram follows:
if
<expression> ;|:|newline <statement> ;|:|newline
[else if
<expression> ;|:|newline <statement> ;|:|newline]
[else
<expression> ;|:|newline <statement> ;|:|newline]
end if
Only one else
statement can exist and it must be last, but multiple
else if
statements are allowed.