Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Text /
Chapter 5 - Text Utilities / Text Utilities Reference
Routines / Defining and Specifying Strings


GetIndString

The GetIndString procedure loads a string from a string list ('STR#') resource into memory. It accesses the string by using the resource ID of the string list and the index of the individual string in that list. The list is read from the resource file if necessary.

PROCEDURE GetIndString (VAR theString: Str255; strListID: Integer; 
                        index: Integer);
theString
On output, the Pascal string result.
strListID
The resource ID of the 'STR#' resource that contains the string list.
index
The index of the string in the list. This is a value from 1 to the number of strings in the list that is referenced by the strListID parameter.
DESCRIPTION
GetIndString returns in the parameter theString a copy of the string from a string list that has the resource ID provided in the strListID parameter. If the resource that you specify cannot be read or the index that you specify is out of range for the string list, GetIndString sets theString to an empty string.

If necessary, GetIndString reads the string list from the resource file by calling the Resource Manager function GetResource. GetIndString accesses the string specified by the index parameter and copies it into theString. The index can range from 1 to the number of strings in the list.

SPECIAL CONSIDERATIONS
GetIndString may move memory; your application should not call this procedure at interrupt time.

ASSEMBLY-LANGUAGE INFORMATION
There is no trap macro for the GetIndString procedure. Instead, you need to use the _GetResource trap macro with the resource type ('STR#') and string index.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996