Operators

InstallShield 2014 » InstallScript Language Reference

An operator is a symbol that specifies a basic operation to be performed using one or two operands—such as addition. The operands can be constants, variables, or function calls. In the example below, the plus sign ( + ) indicates that the variable to the immediate left and the value to the immediate right should be added.

    nCounter + 1;

Operator Functionality

Most InstallScript operators correspond to operators in C and behave very much like their counterparts in that language. As in C, the function of some operators, such as + and ^ depends on the data type of the operands. For example, when a plus sign is used with numeric operands, addition is performed. When a plus sign is used with string operands, concatenation is performed.

Expressions

The combination of operator and operands is called an expression. The example above is a simple expression because it includes only one operator. Complex expressions like the one below specify multiple operations:

    nPrincipal * nRate - nFee;

Evaluating Complex Expressions

In complex expressions, the order in which operations are performed depends on the order of operator precedence. InstallScript operators follow the same order of precedence as C operators. As with C, you can enclose an expression within parentheses to override the order of precedence.

Results

Most expressions produce a new value based on the existing value of the operands. For that reasons, expressions are also referred to by the data type of the result they produce. Arithmetic expressions produce a numeric value, Boolean expressions produce TRUE or FALSE. String expressions produce a string.

See Also