RosettaCodeData/Task/Read-a-file-line-by-line/LiveCode/read-a-file-line-by-line.livecode

14 lines
390 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
command readFileLineByLine
local tFile, tLines, startRead
put "/usr/share/dict/words" into tFile
open file tFile for text read
put true into startRead
repeat until it is empty and startRead is false
put false into startRead
read from file tFile for 1 line
add 1 to tLines
end repeat
close file tFile
put tLines
end readFileLineByLine