Important: The information in this document is obsolete and should not be used for new development.
FormatRecToString
TheFormatRecToString
function 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
StringToFormatRec
function.- 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
FormatRecToString
is the inverse operation ofStringToFormatRec
. The internal representation of the formatting information inmyFormatRec
must have been created by a prior call to theStringToFormatRec
function. The information in the number parts table specifies how to build the string representation.The output number format specification string in
outString
specifies 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
positions
parameter is an array of three integers (aTripleInt
value), which specifies the starting position inoutString
of each of three formatting specifications:
Array entry What its value specifies positions[fPositive] the index in outString
of the first byte of the formatting specification for positive number valuespositions[fNegative] the index in outString
of the first byte of the formatting specification for negative number valuespositions[fZero] the index in outString
of the first byte of the formatting specification for zero number values
FormatRecToString
returns a value of typeFormatStatus
that denotes the confidence level for the conversion that it performed. The low byte of theFormatStatus
value 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
FormatRecToString
to a typeFormatResultType
before working with it.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theFormatRecToString
function 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
GetIntlResourceTable
procedure, which is described in the chapter "Script Manager" in this book.