STRINGTABLE

STRINGTABLE [load-option] [mem-option]
BEGIN
stringID string
.
.
.
END

The STRINGTABLE statement defines one or more string resources for an application. String resources are simply null-terminated ASCII strings that can be loaded when needed from the executable file, using the LoadString function.

Parameters

load-option

Specifies when the resource is to be loaded. This optional parameter must be one of the following keywords:

Option Description

PRELOAD Resource is loaded immediately.
LOADONCALL Resource is loaded when called. This is the default option.

mem-option

Specifies whether the resource is fixed or movable and whether or not it is discardable. This optional parameter can be one of the following keywords:

Option Description

FIXED Resource remains at a fixed memory location.
MOVEABLE Resource can be moved if necessary in order to compact memory.
DISCARDABLE Resource can be discarded if no longer needed.

The default is MOVEABLE and DISCARDABLE.

stringID

Specifies an integer value that identifies the resource.

string

Specifies one or more ASCII strings, enclosed in double quotation marks. The string must be no longer than 255 characters and must occupy a single line in the source file. To add a carriage return to the string, use this character sequence: \012. For example, “Line one\012Line two” would define a string that would be displayed as follows:

Line one
Line two

Comments

Grouping strings in separate segments allows all related strings to be read in at one time and discarded together. When possible, an application should make the table movable and discardable. The Resource Compiler allocates 16 strings per segment and uses the identifier value to determine which segment is to contain the string. Strings with the same upper-12 bits in their identifiers are placed in the same segment.

Examples

The following example demonstrates the usage of the STRINGTABLE statement:

#define IDS_HELLO    1
#define IDS_GOODBYE  2

STRINGTABLE
BEGIN
    IDS_HELLO,   "Hello"
    IDS_GOODBYE, "Goodbye"
END