Conversion results
Formatting and scanning operations always return information about the operation in a TFormatResult or TScanResult instance. The result contains information about the accuracy of the operation. The scan result indicates, additionally, the number of characters within the input text that were actually read during the scanning. TParameterFormatter returns a list of indexed format or scan results corresponding to the list of parameters.
Derive your own classes from TFormatResult or TScanResult when you want to return additional information. For example, the number formatting classes return additional information in TNumberFormatResult and TNumberScanResult (see "Number conversion results" on page 232).
Information about the accuracy of the operation is returned as an enumerated value, representing one of the following confidence levels:
- Perfect--The formatter is very confident about the operation. Performing the reverse operation on the output (scanning the text you just formatted or formatting the data you just scanned) produces the original input.
- Minor error--The formatter had minor trouble but completed the operation without losing significant data. It cannot guarantee that you can successfully perform the reverse operation on the output.
- Recognizable--The formatter completed the operation but is likely to have lost some data. You probably cannot perform the reverse operation on the output.
- Unsatisfactory--The formatter could not complete the operation. The output is unusable.
Use TScanResult and its subclasses to verify that text was properly scanned in before you operate on the resulting TFormattable(s). Use TFormatResult and its subclasses to confirm that binary data was converted as expected; for example, binary numeric data might convert to the infinity identifier.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.
Generated with WebMaker