Important: The information in this document is obsolete and should not be used for new development.
GetString
TheGetString
function loads a string from a string ('STR '
) resource into memory. It returns a handle to the string with the specified resource ID, reading it from the resource file if necessary.
FUNCTION GetString (stringID: Integer): StringHandle;
stringID
- The resource ID of the string (
'STR '
) resource containing the string.DESCRIPTION
TheGetString
function returns a handle to a string with the specified resource ID. IfGetString
cannot read the resource, it returnsNIL
.
GetString
calls theGetResource
function of the Resource Manager to access the string. This means that if the specified resource is already in memory,GetString
simply returns its handle.Like the NewString function, GetString returns a handle whose size is based upon the actual length of the string.
- Note
- If your application uses a large number of strings, it is more efficient to store them in a string list (
'STR#'
) resource than as individual resources in the resource file. You then use the GetIndString procedure to access each string in the list.SPECIAL CONSIDERATIONS
GetString
does not create a copy of the string.
GetString
may move memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theGetString
function is
Trap macro _GetString