LoadStringFromStringTable

InstallShield 2020 » InstallScript Language Reference

The LoadStringFromStringTable function loads the value of the string entry specified by szID into svString. The svString buffer is automatically resized if necessary to accommodate the string value.

Syntax

LoadStringFromStringTable ( szID, svString );

Parameters

LoadStringFromStringTable Parameters

Parameter

Description

szID

Specifies the string identifier of the string entry. Do not prefix the identifier with the at sign (@).

svString

Returns the string value associated with the identifier that is specified by szID.

Return Values

LoadStringFromStringTable Return Values

Return Value

Description

>= ISERR_SUCCESS

Indicates that the string value was successfully loaded into svString.

< ISERR_SUCCESS

Indicates that the string identifier was not found in the String Editor view.

Additional Information

The LoadStringFromStringTable function is case-insensitive when it comes to string identifiers. Therefore, when you use a string identifier in your script, you do not necessarily need to match the case of the string identifier that is specified in the String Editor view. However, mixing case may prevent InstallShield from matching the string entries in the script to the corresponding string entries in the String Editor view at build time. Therefore, it is recommended that you use uppercase for all instances of string identifiers.

The LoadStringFromStringTable function is equivalent to the @ operator, with some exceptions:

When you build a project that includes an InstallScript file (.rul) and the InstallScript code contains one or more references to string entries that use the @ operator, InstallShield validates the string entries at build time. If a string identifier in the project’s InstallScript file is not defined as one of the project’s string entries in the String Editor view, InstallShield displays build warning -7174. If you use LoadStringFromStringTable, InstallShield does not validate the string entries at build time; scripts that use LoadStringFromStringTable are assumed to have their own string-not-found error handling.
If the specified identifier does not exist in the String Editor view, the @ operator causes a message box to be displayed at run time; LoadStringFromStringTable simply returns failure (< ISERR_SUCCESS).

See Also