Program freezes
Posted: Sun Jul 01, 2018 12:12 am
I hope I'm offending anyone but, this code:
[code]FH1=OpenFile(FP$):FH2=WriteFile(FQ$)
While Not Eof(FH1)
BT=ReadByte(FH1)
Repeat
AW$=AW$+Chr$(BT):BT=ReadByte(FH1)
Until BT=32
WriteLine(FH2,AW$):AW$="":NW=NW+1
Wend
Print NW+" WRITTEN"[/code]
reads a file a byte at a time. When a space separator is found it then writes the word to another file.
About or near the 100,000th word, the program then freezes.
I know some of you will write that I'm on the forum however some of you are familiar with this.
[code]FH1=OpenFile(FP$):FH2=WriteFile(FQ$)
While Not Eof(FH1)
BT=ReadByte(FH1)
Repeat
AW$=AW$+Chr$(BT):BT=ReadByte(FH1)
Until BT=32
WriteLine(FH2,AW$):AW$="":NW=NW+1
Wend
Print NW+" WRITTEN"[/code]
reads a file a byte at a time. When a space separator is found it then writes the word to another file.
About or near the 100,000th word, the program then freezes.
I know some of you will write that I'm on the forum however some of you are familiar with this.