User-Defined

nameID typeID [load-option] [mem-option] filename
nameID typeID [load-option] [mem-option]
BEGIN
raw-data
.
.
.
END

A user-defined resource statement specifies a resource that contains application-specific data. The data can have any format and can be defined either as the content of a given file (if the filename parameter is given) or as a series of numbers or strings (if the raw-data parameter is given).

Parameters

nameID

Specifies either a unique name or an integer that identifies the resource.

typeID

Specifies either a unique name or an integer that identifies the resource type. If a number is given, it must be greater than 255. The numbers 1 through 255 are reserved for existing and future predefined resource types.

load-option

Specifies when the resource is to be loaded. The parameter must be one of the following options:

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 it is discardable. The parameter must be one of the following options:

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 for cursor, icon, and font resources. The default for bitmap resources is MOVEABLE.

filename

Specifies the name of the file that contains the resource data. The parameter must be a valid MS-DOS filename; it must be a full path if the file is not in the current working directory.

raw-data

Specifies one or more integers and strings. Integers can be in decimal, octal, or hexadecimal format.

Examples

The following example shows several user-defined statements:

array   MYRES   data.res
14      300     custom.res
18 MYRES2
BEGIN
  "Here is a data string\0", /* A string. Note: explicitly
                                null-terminated */
   1024,                     /* int        */
   0x029a,                   /* hex int    */
   0o733,                    /* octal int  */
   "\07"                     /* octal byte */
END