Difference between revisions of "IF"
Helengeorge (Talk | contribs) (→Class) |
Barrymavin (Talk | contribs) (→Products) |
||
(One intermediate revision by one user not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
Conditional command execution | Conditional command execution | ||
Line 42: | Line 40: | ||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Applications]] | [[Category:Applications]] | ||
[[Category:Applications Commands]] | [[Category:Applications Commands]] | ||
+ | [[Category:Looping Commands]] |
Latest revision as of 09:40, 30 November 2009
Purpose
Conditional command execution
Syntax
IF <condition>
[ELSEIF<condition>]
[ELSE]
ENDIF
See Also
Description
The IF command provides a conditional selection of commands to execute based upon a logical <condition>. If the result of the <condition> is .T., then the commands following the IF, up to an ENDIF statement or an ELSE statement are executed. IF statements may be nested, i.e. IF statements may contain other IF statements, provided that the ELSE and ENDIF statements correspond with a valid IF.
ELSEIF
The ELSEIF clause can be added to the IF control structure allowing for the testing of more than one condition in the IF...ENDIF block. The IF block is now essentially the same as the DO CASE structure. ELSEIF is analogous with the CASE statement.
ELSE
The ELSE statement is analogous with the OTHERWISE statement. If no previous IF <condition> or ELSEIF <condition> is true, the commands following the ELSE statement up to the ENDIF statement are executed.
Example
use patrons index events, names seek "BALLET" if found() edit else dialog message "Record not found." endif
Products
Recital Server, Recital