|
<< Index >> |
FutureBasic |
long if (deprecated - use if instead) | statement | |
|
[long] if expr
[statementBlock1]
[xelse
[statementBlock2]]
end if
long if
statement marks the beginning of an "if-block," which must be terminated with the end if
statement. The expr
can be either a logical expression (such as: personCount>17
), a numeric expression, or a string. A numeric expression is counted as "true" if it evaluates to a nonzero value. A string is counted as "true" if its length is greater than zero.expr
is "true," then only the statements in statementBlock1
are executed, and execution then continues at the first statement after end if
. if expr
is "false," then only the statements in statementBlock2
(if any) are executed, and execution then continues at the first statement after end if
.statementBlock1
and statementBlock2
may contain any number of executable statements, and may even include other "nested" if-blocks.if
statement instead. To conditionally execute statement blocks based on more complex conditions, use the select case
statement.long if x# = 1