03-23-2024, 11:30 AM
(This post was last modified: 03-23-2024, 11:31 AM by 1micha.elok.)
Question
Case 1 : I think ... [for...next] is not the best way to read text file
Case 2 : I think this is the best way, but [do..until frln(f) = "unset"] gives unexpectedly output
Please advice me what is the best way to read the whole text file ?
Thank you.
Case 1 : I think ... [for...next] is not the best way to read text file
Case 2 : I think this is the best way, but [do..until frln(f) = "unset"] gives unexpectedly output
Please advice me what is the best way to read the whole text file ?
Thank you.
Code:
set window "readfile",400,400
f = openfile("story.txt")
'Case 1
'correctly read file
for i = 0 to 21
wln frln(f)
i = i + 1
next
'Case 2
'uncorrectly read file
do
wln frln(f)
until frln(f)="unset"
free file f
temp=rln()