Setting or Getting Multi-Line Strings in the Registry

InstallShield 2020

Project:This information applies to InstallScript projects.

Setting Multi-Line Strings

To set multi-line strings, call the RegDBSetKeyValueEx function. The szValue parameter should contain the substrings to be added, separated by null characters. You must add two null characters to the end of the main string to denote its end. To create such a string, follow these steps:

1. Initialize the string to contain each of the substrings, separated by space characters.
2. Assign the ASCII value for a null string to the string positions after each line.
3. Assign an additional null character (ASCII value 0) to the end of the string.

For example:

svValue = "This is line one. This is line two. This is line three. ";

svValue[17] = 0;

svValue[35] = 0;

svValue[55] = 0;

svValue[56] = 0;

Retrieving Multi-Line Strings

To get multi-line strings, call the RegDBGetKeyValueEx function. The substrings will be returned in a main string, separated by null characters. To extract them, use the following code to read the strings into a string list and display them in an SdShowInfoList dialog:

// svValue is the string read in by RegDBGetKeyValueEx

listID = ListCreate( STRINGLIST );

if (listID != LIST_NULL) then

    StrGetTokens( listID, svValue, "" );

    SdShowInfoList( szTitle, szMsg, listID );

endif;

See Also