Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
RESOURCE (1.2)
◄Up► ◄Next► ◄Previous►
────────────────────────────────────────────────────────────────────────────
The Resource Compiler RESOURCE Statement
RESOURCE type-id resource-id [load-option] [mem-option] filename
The RESOURCE statement defines a custom resource for an application. A
custom resource can be any data in any format. The RESOURCE statement copies
the custom resource from the specified file and adds it to the application's
other resources. A custom resource can be loaded from the executable file
when needed by using the DosGetResource or DosGetResource2 function and
specifying the resource's type and resource identifier.
You can provide any number of RESOURCE statements in a resource-definition
file, but each statement must specify a unique combination of type-id and
resource-id values. That is, RESOURCE statements having the same type-id
value are permitted as long as the resource-id value for each is unique.
Field Description
────────────────────────────────────────────────────────────────────────────
type-id Specifies the custom-resource type. This value must be an
integer in the range 256 through 65,535, or a simple expression
that evaluates to a value in that range. (Values 0 through 255
are reserved.)
resource-id Specifies the custom-resource 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.
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 DosGetResource or DosGetResource2
function. This is the default option.
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.
filename Specifies the name of the file containing the custom resource.
If the file is not in the current directory, filename must be
preceded by a full path.
Example
This example defines a custom resource whose type identifier is 300 and
whose resource identifier is 14. The custom resource is copied from the file
custom.res.
RESOURCE 300 14 custom.res
See Also
DosGetResource
♦