| Reference > Rule Languages > ILOG Rule Language > IRL Keywords > else (in if) |
else (in if) |
PREVIOUS NEXT |
A right-hand side statement within an if statement for executing an alternate statement block according to a Boolean expression value. This keyword is used in rule actions or functions.
if (test) {statement}
else {statement}
The if statement is used in the action part of a rule, a function, or a ruleflow. The test may be any legal test as in the programming language Java. If the test returns true, the first statement block is executed and the else block is skipped over. If the test returns false, the first block is skipped over and the statement block following the else is executed.
In a rule or function, any ILOG Rule Language statement may be executed within the statement block as well as arithmetic expressions and method calls. In a ruleflow, any ruleflow statements may be executed within the statement block. A statement block may consist of one or more statements. A single statement does not require the braces ({}). The else keyword and its statement block is optional.
| Copyright © 1987-2008 ILOG S.A. All rights reserved. Legal terms. Documentation homepage. | PREVIOUS NEXT |