Each resource statement consists of one or more keywords, numbers , character strings, constants, or file names. You combine these to define the resource type, identifier, and data.
Keywords, except for those specifying directives, can be any combination of uppercase and lowercase letters. Note that the curly braces, { and }, are reserved characters. You can use them in place of the BEGIN and END keywords.
The following example shows several numbers represented in decimal, octal, and hexadecimal notation:
DECIMAL | HEXADECIMAL | OCTAL |
1 | 0x1 | 0o1 |
10 | 0xA | 0o12 |
255 | 0xFF | 0o377 |
-1 | 0xFFFF | 0o177777 |
65535 | 0xFFFF | 0o177777 |
The ranges specific to each are listed in the following table.
Signed Range | Unsigned Range | Character String | |
---|---|---|---|
Identifiers | -32768 to 32767 | 1 through 65535 | Yes |
Coordinates | -32768 to 32767 | 0 through 65535 | No |
Dimensions | Not applicable | 0 through 65535 | No |
You can also use simple expressions that evaluate to a value in the appropriate range; this enables you to, for example, specify dimensions or coordinates that are relative to those of a corresponding dialog window or menu. A resource identifiers encoded as an expression must resolve to an unsigned integer, not a string.
The Resource Compiler interprets the backslash (\) as an escape character in character strings. You can include any ASCII character in a character string by specifying either \xdd, where dd is the hexadecimal representation of an ASCII character, or \nnn, where nnn is the octal representation of an ASCII character. If a backslash is required in a string, you must include the backslash twice.
In addition, when character strings are used as resource identifiers additional rules apply:
Resource statements have three basic forms:
Single-line statements | Single-line statements
consist of a keyword identifying the resource type , a
number or character string that specifies the resource
identifier, and a file name specifying the file
containing the resource data. For example, this ICON
statement defines an icon resource: ICON 1 myicon.ico The icon resource has the icon identifier 1. The file myicon.ico contains the icon data. The same example, using a character string is shown below: ICON "MyIcon" myicon.ico |
Multiple-line statements | Multiple-line statements
consist of a keyword identifying the resource type, a
number or character string that specifies the resource
identifier, and, between the BEGIN and END keywords,
additional resource statements that define the resource
data. For example, this MENU statement defines a menu
resource: MENU 1 BEGIN MENUITEM "Alpha", 101 MENUITEM "Beta", 102 END The menu identifier is 1. The menu contains two MENUITEM statements that define the contents of the menu. In multiple-line statements, irc allows any level of nested statements. Nested statements let you define controls and other child windows for dialog boxes and windows. If a nested statement creates a child window or control, the parent and owner of the new window is the window created by the containing statement. FRAME statements may occasionally create frame controls whose parent and owner windows are not the same. |
Directives | Directives consist of the reserved character # in the first column of a line, followed by the directive keyword and any additional numbers, character strings, or file names. |
Resource Compiler -
An Overview
Resource Compiler -
Resource Script Files
Resource Compiler -
Syntax