Anonymous user
Input loop: Difference between revisions
no edit summary
No edit summary |
|||
Line 301:
</lang>
=={{header|Pascal / Delphi}}==
// for stdio
var
s : string ;
begin
repeat
readln(s);
until s = "" ;
// for a file
var
f : text ;
s : string ;
begin
assignfile(f,'foo');
reset(f);
while not eof(f) do
readln(f,s);
closefile(f);
end;
=={{header|Perl}}==
The angle brackets operator ( <tt><...></tt> ) reads one line at a time from a filehandle in scalar context:
|