|
||
NAME
statement
<name-statement>
NAME
<short-name>
Use this statement to ensure that the resources in the file have a unique ID so that an application can use multiple resource files without resource ID conflict.
This statement must be the first non-comment statement in the file.
The short-name must be between one and four alphabetic characters long and be unique (no other file may use the same one). For the sake of consistency this constant should be in upper case although lower case is allowed (and will be converted to upper case by the compiler). This short-name is then converted into a number and shifted onto the leading 20 bits of the resource ID, leaving the bottom 12 bits for the number of the resource in the file. This allows a maximum of 4095 resources to be defined in a source file.
Since the NAME
statement maps all resource IDs within the file onto 32-bit numbers, only LLINK
s may be used for resource references in that file. Using the NAME
statement in a resource file means that any attempt to use a LINK
will generate an error.
With NAME
set to AAAA
, if this resource is the first resource in the file
RESOURCE STRING one
{
wd=5;
}
the first entry in the generated header file will be
#define ONE 0x04FD8001
04FD8 is the leading 20 bits for all IDs in the file and 001 is the reference of that resource within the file.