InstallShield 2019 » InstallScript Language Reference
The simplest if statement evaluates an expression and performs a specified action if the expression is true. If the expression is not true, InstallShield ignores the entire statement. For example:
if (szStringA = "exit") then
AskYesNo ( "Are you sure you want to exit?", NO );
endif;
If szStringA equals "exit", the test evaluates to TRUE (1) and the AskYesNo function is called. If szStringA contains anything else, the result is FALSE (0) and the entire statement is ignored.
The sample code below compares the values of the variable nDialog and the constant DLG_ERR. If they are equivalent, InstallShield executes the MessageBox function:
if (nDialog = DLG_ERR) then
MessageBox ("Error has occurred", WARNING);
endif;
Tip • You may find that your if statement is easier to read when you place the expression to be evaluated in parentheses, but the parentheses are optional in InstallScript.
See Also
InstallShield 2019 Help LibraryApril 2019 |
Copyright Information | Flexera |