Hitachi

JP1 Version 12 JP1/IT Desktop Management 2 Distribution Function Administration Guide


18.6.3 if-else-endif

The if statement allows a conditional branch to be processed.

If the condition evaluates to a value other than 0, the main part of the if statement is executed. If it is 0, the sections other than the main part are executed.

In this statement, the sections other than the main part are options. You have to enclose a condition by parentheses.

Organization of this subsection

(1) Format

if (condition)
    [expression-1;]
[else
    [expression-2;]]
endif;

(2) Description

Conditions are subject to evaluation. If the condition is not 0, expression-1 in (1) is executed and, if it is 0, expression-2 is executed.

In the if-else-endif statement, the else clause is associated with the immediately preceding if statement which does not have the associated else statement.

(3) Example of coding

if(AIT_FocusWindow("Installable Software-Setup","#32770"))
                   // The following two lines are executed 
                   // if the condition is true (other than 0).
   AIT_LogMessage("INSIDE Installable Software SETUP");
   AIT_PlayKey("ENTER");
else
                   // The following two lines are executed 
                   // if the condition is false (0).
   AIT_LogMessage("PROBLEM IN SETUP");
   AIT_Exit();
endif;