Important: The information in this document is obsolete and should not be used for new development.
NewString
TheNewString
function allocates memory in the heap for a string, copies its contents, and produces a handle for the heap version of the string.
FUNCTION NewString (theString: Str255): StringHandle;
theString
- A Pascal string that you want copied onto the heap.
DESCRIPTION
NewString
returns a handle to the newly allocated string. If the string cannot be allocated,NewString
returnsNIL
. The size of the allocated string is based on the actual length oftheString
, which may not be 255 bytes.
- Note
- Before using Pascal string functions that can change the length of the string, it is a good idea to maximize the size of the string object on the heap. You can call either the
SetString
procedure or the Memory Manager procedureSetHandleSize
to modify the string's size.SPECIAL CONSIDERATIONS
NewString
may move memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro for theNewString
function is
Trap macro _NewString