DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


ReadFPNum

Declaration: TMixedFStream.ReadFPNum(AllowExp: boolean; DecPoint: integer): double;
The function ReadFPNum reads and decodes a floating point number from the text stream, 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 be in exponential notation. The parameter DecPoint determines which character is accepted as decimal separator:

DecPoint accepted character
1 dot
2 comma
3 either comma or dot

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

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

Hint 2: In order to avoid reading data beyond the end of the stream, the user should call the function Eos before reading the stream data. Reading beyond the end of the stream yields undefined results.