27 Dec
2001
27 Dec
'01
10:47 p.m.
Accordnig to both ISO standards, readln(f) should be equivalent to get(f), when eoln(f) is true. In GPC the former seems to be implemented as lazy I/O, while the latter does not. Here is an example (enter three lines of text to test it). ---------------------------- program echo3lines(input,output); procedure copyline; begin while not eoln do begin output^:=input^; get(input); put(output) end end; begin write('Enter the first line: '); copyline; readln; writeln; write('Enter the second line: '); copyline; get(input); writeln; write('Enter the last line: '); copyline; readln; writeln end. ---------------------------------------- Is this a bug or a feature? Emil Jerabek
8990
Age (days ago)
8996
Last active (days ago)
15 comments
4 participants
participants (4)
-
Emil Jerabek -
Frank Heckenbach -
marcov@stack.nl -
morten.gulbrandsen@t-online.de