if
 
 
 

Syntax:

if ( <condition> ) <true statement> else <false statement>

or

if ( <condition> ) <true statement>

Purpose:

The if statement is used to conditionally execute statements. The <condition> is just an expression interpreted as a truth value. An expression is considered true if its value is non-zero, and false if its value is zero. If <condition> is true, the <true state-ment> is executed. Otherwise, the <false statement> is executed. The if statement can be abbreviated by omitting the else and the <false statement>.

In its abbreviated form, the if statement will execute the <true statement> if the <condition> is true, and pass on to the next statement if it is false. <true state-ment> and <false statement> may be any statement valid in the MODEL section (including if statements and {} groupings). The end of an if statement is marked by the end of the <false statement> (or by the end of the <true statement> in the abbreviated form).

Example:

if (frame > 1)  begun = TRUE;