Important: The information in this document is obsolete and should not be used for new development.
SetResLoad
You can use theSetResLoadprocedure 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 theloadparameter 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 toNILunless the resource is already in memory. In addition, when first opening a resource fork the Resource Manager won't load into memory resources whoseresPreloadattribute is set.You can use the
SetResLoadprocedure 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 theLoadResourceprocedure, which is described next.
- WARNING
- If you call
SetResLoadwith theloadparameter set toFALSE, be sure to callSetResLoadwith theloadparameter set toTRUEas 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 ofSetResLoadis stored in the global variableResLoad.RESULT CODE
noErr 0 No error SEE ALSO
To check for errors, call theResErrorfunction 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.