String Comparisons

InstallShield 2019

When InstallShield compares two strings, it starts by comparing the initial character in the first string with the initial character in the second string. If those characters are equal, InstallShield then compares the characters in the next position of each string. If those characters are also equal, it moves on to the characters in the next position, continuing in sequence until it encounters one of the following conditions:

Two characters in the same relative position in the two strings do not match. In this case, InstallShield bases its resolution on the comparison of those two characters. If the character in string one has a greater value than the character in the corresponding position of string two, then string one is greater; otherwise string two is greater.
The end of one string is encountered without finding unequal characters in corresponding positions. In this case, the strings are of unequal length and therefore they are not equal.
The end of both strings is reached without finding unequal characters in corresponding positions. In this case, the strings are equal in length and all characters match; therefore the strings are equal.

Consider the following example:

svString1 = "trusting";

    svString2 = "TRUTHFUL";

    

    if svString1 = svString2 then

        MessageBox("Equal", INFORMATION);

    else

        MessageBox("Not Equal", INFORMATION);

    endif;

String comparisons are not case-sensitive. Because an uppercase character is equal to its lowercase counterpart, InstallShield finds that the first three characters of trusting and the first three characters of TRUTHFUL are equivalent. The comparison ends with the test of the characters in the fourth position of each string. Since s is lower than t in the ASCII character table, svString1 does not equal svString2. The remaining characters are not compared and the else branch is executed.

Note • The value of each character is based on its ASCII value. For information about the ASCII values of specific characters and symbols, refer to a basic programming manual.