March 2000
Intermediate to advanced
576 pages
18h 13m
English
SeekEoln Function
function SeekEoln(var F: Text = Input): Boolean
SeekEoln skips over white space characters and
then returns True if the text file is at the end of file or end of
line. Eoln interprets a carriage return
(#13) as the end of line. It returns False if
there is more text to read and the next character is not a carriage
return. SeekEoln is not a real
function.
If the file F is not open,
SeekEoln reports runtime error 103.
The file must have been opened by calling Reset.
If the file F was opened by calling
Rewrite or Append,
SeekEoln reports runtime error 104.
// Read a series of numbers on one line of text.
// Return the sum of those numbers.
function SumLine: Double;
var
X: Double;
begin
Write('Number list: ');
Result := 0.0;
while not SeekEoln do
begin
Read(X);
Result := Result + X;
end;
end;| Eoln Function, IOResult Function, Reset Procedure, SeekEof Procedure, TextFile Type |
Read now
Unlock full access