STRINGTABLE Statement

Summary: Syntax

STRINGTABLE[[loadoption]] [[memoption]]
BEGIN
stringID string
END

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

The optional loadoption field takes a keyword that specifies when the resource is to be loaded. It must be one of the following:

PRELOAD

Resource is loaded immediately.

LOADONCALL

Resource is loaded when called. This is the default option.

The optional memoption field takes the following keyword or keywords, which specify the memory status of the resource:

FIXED

Resource remains at a fixed memory location.

MOVEABLE

Resource can be moved if necessary to compress memory.

DISCARDABLE

Resource can be discarded if no longer needed.

The default is both MOVEABLE and DISCARDABLE.

The stringID field specifies an integer value that identifies the resource.

The string field 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 defines a string that would be displayed as follows:

Line one

Line two

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 moveable 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.

The following example demonstrates the correct usage of the STRINGTABLE statement:

#define IDS_HELLO 1

#define IDS_GOODBYE 2

STRINGTABLE

BEGIN

IDS_HELLO, “Hello”

IDS_GOODBYE, “Goodbye”

END