Concatenate Operator (+)

InstallShield 2019 » InstallScript Language Reference

Use the concatenate string operator ( + ) to join one string to the end of another. Concatenating two strings results in a new, third string. In the following example, two string constants are concatenated and the resulting string value is assigned to the string variable szThirdString; after the statement has been executed, the value of szThirdString is “First string Second string”.

    szThirdString = "First string " + "Second string";

Operands in a concatenation expression may be string literals, string constants, or string variables. In the example below, a string constant and a string literal are concatenated. The resulting string value is assigned to szThirdString.

#define FIRST_STRING "This is the first string"

 

    STRING szThirdString;

 

// . . .

 

   szThirdString = FIRST_STRING + "Second string";

Caution • When assigning the result of a concatenation expression to a string variable, you must ensure that the concatenated string is not too long for the string variable to which it is assigned. A statement that assigns a string to a variable of insufficient size produces run-time error 401.

See Also