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 / Converting Between Integers and Strings


NumToString

The NumToString procedure converts a long integer value into a Pascal string.

PROCEDURE NumToString (theNum: LongInt; VAR theString: Str255);
theNum
A long integer value.
theString
On output, contains the Pascal string representation of the number.
DESCRIPTION
NumToString creates a string representation of theNum as a base-10 value and returns the result in theString.

If the value of the number in the parameter theNum is negative, the string begins with a minus sign; otherwise, the sign is omitted. Leading zeros are suppressed, except that a value of 0 produces the string "0". NumToString does not include thousand separators or decimal points in its formatted output.

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

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the NumToString procedure are
Trap macroSelector
_Pack7$0000

The registers on entry and exit for this routine are
Registers on entry
A0pointer to the length byte that precedes theString
D0the long integer value to be converted
Registers on exit
D0pointer to the length byte that precedes theString


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996