Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Uncorrectly read file
#1
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.

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()


Attached Files
.n7   readfile.n7 (Size: 256 bytes / Downloads: 2)
.txt   story.txt (Size: 147 bytes / Downloads: 3)
Reply


Messages In This Thread
Uncorrectly read file - by 1micha.elok - 03-23-2024, 11:30 AM
RE: Uncorrectly read file - by Marcus - 03-23-2024, 01:46 PM
RE: Uncorrectly read file - by Tomaaz - 03-23-2024, 02:28 PM
RE: Uncorrectly read file - by Marcus - 03-23-2024, 03:40 PM
RE: Uncorrectly read file - by 1micha.elok - 03-24-2024, 09:09 AM
RE: Uncorrectly read file - by Tomaaz - 03-24-2024, 05:28 PM
RE: Uncorrectly read file - by 1micha.elok - 03-24-2024, 11:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)