Important: The information in this document is obsolete and should not be used for new development.
SetResLoad
You can use theSetResLoad
procedure to enable and disable automatic loading of resource data into memory for routines that return handles to resources.
PROCEDURE SetResLoad (load: Boolean);
load
- A Boolean value that determines whether Resource Manager routines should read resource data into memory. If you set this parameter to
TRUE
, Resource Manager routines that return handles will, during subsequent calls, automatically read resource data into memory if it is not already in memory; if you set this parameter toFALSE
, Resource Manager routines will not automatically read resource data into memory.DESCRIPTION
Routines that return handles to resources normally read the resource data into memory if it's not already there. The default setting(load = TRUE)
maintains this state. If theload
parameter is set toFALSE
, routines that return handles to resources will not, during subsequent calls, load the resource data into memory. Instead, such routines return a handle whose master pointer is set toNIL
unless the resource is already in memory. In addition, when first opening a resource fork the Resource Manager won't load into memory resources whoseresPreload
attribute is set.You can use the
SetResLoad
procedure when you want to read from the resource map without reading the resource data into memory. To read the resource data into memory after a call toSetResLoad
, call theLoadResource
procedure, which is described next.
- WARNING
- If you call
SetResLoad
with theload
parameter set toFALSE
, be sure to callSetResLoad
with theload
parameter set toTRUE
as soon as possible. Other parts of system software that call the Resource Manager expect this value to beTRUE
, and some routines won't work if resources are not loaded automatically.ASSEMBLY-LANGUAGE INFORMATION
The current value ofSetResLoad
is stored in the global variableResLoad
.RESULT CODE
noErr 0 No error SEE ALSO
To check for errors, call theResError
function as described on page 1-47.For more information about the global variable
ResLoad
, see "Inserting the ROM Resource Map" beginning on page 1-128.