Important: The information in this document is obsolete and should not be used for new development.
StringToExtended
TheStringToExtended
function converts a string representation of a number into a floating-point number.
FUNCTION StringToExtended(source: Str255; myFormatRec: NumFormatStringRec; partsTable: NumberParts; VAR x: Extended80): FormatStatus;
source
- A Pascal string that contains the string representation of a number.
myFormatRec
- The internal representation of the formatting information for numbers, as produced by 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).x
- On output, contains the 80-bit SANE representation of the
floating-point number.DESCRIPTION
StringToExtended
uses the internal representation of number formatting information that was created by a prior call toStringToFormatRec
to parse the input number string. It uses the number parts table to determine the components of the number string that is being converted.StringToExtended
parses the string and then converts the string to a simple form, stripping nondigits and replacing the decimal point before converting it into a floating-point number. If the input string does not match any of the patterns, thenStringToExtended
parses the string as well as it can and returns a confidence level result that indicates the parsing difficulties.
StringToFormatRec
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
StringToExtended
to a typeFormatResultType
before working with it.SPECIAL CONSIDERATIONS
StringToExtended
returns an 80-bit, not a 96-bit, representation.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theStringToExtended
function are
Trap macro Selector _ScriptUtil $8210 FFE6 SEE ALSO
For comprehensive details on the number parts table, see the description of the tokens ('itl4'
) resource in 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.