next up previous contents index
Next: WHILE: Repeated Execution Up: Control Statements Previous: MAKESEQ Statement   Contents   Index


IF: Conditional Execution

Conditional execution can be requested by an IF statement. It allows usages similar to the C language if statement:

IF (logical) statement;
IF (logical) statement; ELSE statement;
IF (logical) { statement-group; }
IF (logical) { statement-group; } ELSE { statement-group; }
Note that all statements must be terminated with semicolons (;), but there is no semicolon after a closing brace. The statement or group of statements following the IF is executed if the condition is satisfied. If the condition is false, and there is an ELSE, the statement or group following the ELSE is executed.



MAD User Guide, http://wwwslap.cern.ch/mad/