Important: The information in this document is obsolete and should not be used for new development.
FormatRecToString
TheFormatRecToStringfunction converts an internal representation of number formatting information into a number format specification string, which can be displayed and modified.
FUNCTION FormatRecToString(myFormatRec: NumFormatStringRec; partsTable: NumberParts; VAR outString: Str255; VAR positions: TripleInt): FormatStatus;
myFormatRec- The internal representation of number formatting information, as created by a previous call to the
StringToFormatRecfunction.- partsTable
- A record obtained from the tokens (
'itl4') resource that shows the correspondence between generic number part separators (tokens) and their localized version (for example, a thousand separator is a comma in the United States and a decimal point in France).outString- On output, contains the number format specification string.
positions- An array that specifies the starting position and length of each of the three possible format strings (positive, negative, or zero) in the number format specification string. Semicolons are used as separators in the string.
DESCRIPTION
FormatRecToStringis the inverse operation ofStringToFormatRec. The internal representation of the formatting information inmyFormatRecmust have been created by a prior call to theStringToFormatRecfunction. The information in the number parts table specifies how to build the string representation.The output number format specification string in
outStringspecifies how numbers appear. This string contains three parts, which are separated by semicolons. The first part is the positive number format, the second is the negative number format, and the third part is the zero number format. The syntax for this string is described in detail in "Using Number Format Specification Strings," which begins on page 5-39.The
positionsparameter is an array of three integers (aTripleIntvalue), which specifies the starting position inoutStringof each of three formatting specifications:
Array entry What its value specifies positions[fPositive] the index in outStringof the first byte of the formatting specification for positive number valuespositions[fNegative] the index in outStringof the first byte of the formatting specification for negative number valuespositions[fZero] the index in outStringof the first byte of the formatting specification for zero number values
FormatRecToStringreturns a value of typeFormatStatusthat denotes the confidence level for the conversion that it performed. The low byte of theFormatStatusvalue is of typeFormatResultType, the values of which are described in Table 5-6 on page 5-38.
- IMPORTANT
- Be sure to cast the result of
FormatRecToStringto a typeFormatResultTypebefore working with it.![]()
ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theFormatRecToStringfunction are
Trap macro Selector _ScriptUtil $8210 FFEA SEE ALSO
For comprehensive details on the number parts table, see the appendix "International Resources" in this book.To obtain a handle to the number parts table from a tokens resource, use the
GetIntlResourceTableprocedure, which is described in the chapter "Script Manager" in this book.