STRINGTABLE (1.2)
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
The Resource Compiler STRINGTABLE Statement
STRINGTABLE [load-option] [mem-option]
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 function.
You can provide any number of STRINGTABLE statements in a
resource-definition 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-definition file can have the
same string identifier.
Field Description
────────────────────────────────────────────────────────────────────────────
load-option Specifies when the system loads the resource from the
executable file into memory. This value must be one of
the following:
Value Meaning
─────────────────────────────────────────────────────────
PRELOAD System loads the resource when the
application starts.
LOADONCALL System loads the resource when the
application calls the WinLoadString function.
This is the default value.
mem-option Specifies how the system manages the resource when it is
in memory. This value must be one or more of the
following:
Value Meaning
─────────────────────────────────────────────────────────
FIXED System keeps the resource at a fixed memory
location.
MOVEABLE System moves the resource as necessary to
compact memory.
DISCARDABLE System discards the resource if it is no
longer needed.
The default setting is MOVEABLE and DISCARDABLE.
string-id Specifies the character-string identifier. This value
must be an integer in the range 0 through 65,535, or a
simple expression that evaluates to a value in that
range. The value can be specified in decimal or
hexadecimal notation. Each string identifier in a
resource-definition file must be unique.
string-definition Specifies a character string. This field must contain
zero or more characters enclosed in double quotation
marks. Character values must be in the range 1 through
255. If a double quotation mark is required in the
string, you must include the double quotation mark
twice.
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
See Also
MESSAGETABLE
♦