Syntax:
STRINGTABLE [load-option] [mem-option] [codepage] BEGIN string-id string-definition . . . END
The STRINGTABLE statement creates one or more string resources for an application. A string resource is a null-terminated character string that has a unique string identifier. A string resource can be loaded from the executable file when needed by using the WinLoadString or with DosGetResource with the RT_STRING resource type. RT_STRING resources are bundled together in groups of 16, with any missing IDs replaced with zero length strings. Each group, or bundle, is assigned a unique sequential identifier. The resource string identifier is not necessarily the same as the identifier specified when using DosGetResource. The formula for calculating the identifier of the resource bundle, for use in DosGetResource, is as follows:
bundle ID = (id / 16) +1where id is the string ID assigned in the RC file.
Thus, bundle 1 contains strings 0 to 15, bundle 2 contains strings 16 to 31, and so on. Once the address of the bundle has been returned by DosGetResource (using the calculated identifier), the buffer can be parsed to locate the particular string within the bundle. The number of the string is calculated by the formula:
string = id % 16(string = remainder for id/16).
The buffer returned consists of the CodePage of the strings in the first USHORT, followed by the 16 strings in the bundle. The first BYTE of each string is the length of the string (including the null terminator), followed by the string and the terminator. A zero length string is represented by two bytes: 01 (string length) followed by the null terminator.
You can provide any number of STRINGTABLE statements in a resource script file. The compiler treats all the strings from the various STRINGTABLE statements as if they belonged to a single statement. This means that no two strings in a resource script file can have the same string identifier.
load-option
PRELOAD
FIXED
Comments
You can continue a string on multiple lines by terminating the line with a backslash (\) or by terminating the line with a double quotation mark (") and then starting the next line with a double quotation mark.
Example
This example creates two string resources whose string identifiers are 1 and 2.
#define IDS_HELLO 1#define IDS_GOODBYE 2 STRINGTABLE BEGIN IDS_HELLO "Hello" IDS_GOODBYE "Goodbye" END