RosettaCodeData/Task/Read-a-file-line-by-line/LiveCode/read-a-file-line-by-line.livecode
2023-07-01 13:44:08 -04:00

13 lines
390 B
Text

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