The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....


Class: none
Declaration: function ScanStreamFPNum (Instream: TStream; AllowExp: boolean; DecPChar: integer; var Idx: integer): double;

The function ScanStreamFPNum decodes a floating point number from a stream. The parameter Instream contains the number to be scanned, starting at the current stream position. Valid characters are the digits '0'...'9', 'E', '.', leading '-' and '+' signs, and leading blanks (ASCII 32), leading tabs (ASCII 9), leading line feeds (ASCII 10) and leading carriage returns (ASCII 13). If the parameter AllowExp is set TRUE the scanned number may be optionally stored in exponential notation. The parameter DecPChar determines which character is accepted as decimal separator:

DecPChar accepted character
1 dot
2 comma
3 both

On return, ScanStreamDecimal contains the corresponding floating point number; the property Position of the stream points to the first character after the scanned number.

Hint: If ScanFPNum encounters a number which is greater than uc_MaxDouble, or less than -uc_MaxDouble, a value of uc_MaxDouble (-uc_MaxDouble) is returned.

Last Update: 2012-Oct-20