Read a file line by line: Difference between revisions

Content added Content deleted
(GP can't; PARI solution is C's. In the future GP may be able to do this, based on the TODO.)
m ({{header|Liberty BASIC}})
Line 535: Line 535:
}
}
}</lang>
}</lang>

=={{header|Liberty BASIC}}==
<lang lb>filedialog "Open","*.txt",file$
if file$="" then end
open file$ for input as #f
while not(eof(#f))
line input #f, t$
print t$
wend
close #f</lang>
Mac
<lang lb>filedialog "Open","*.txt",file$
if file$="" then end
open file$ for input as #f
while not(eof(#f))
t$ = inputto$(#f, chr$(13))
print t$
wend
close #f </lang>
Unix
<lang lb>filedialog "Open","*.txt",file$
if file$="" then end
open file$ for input as #f
while not(eof(#f))
t$ = inputto$(#f, chr$(10))
print t$
wend
close #f </lang>


=={{header|Logo}}==
=={{header|Logo}}==