^^^ After a few seconds of not typing anything, open to read fails. Everything works, just crashes after a few seconds. Not the complete code!! (Non essential code ommited)
ViewBook1:
a=OpenToRead("People.txt")
Cls
Print ""
Search$=Input("Find:")
If Search = "" Then
If Not EOF(a) Then
iLine$ = ReadLine(a)
Print iLine
Drawscreen
Goto ViewBook1
Else
Goto ViewBook1
EndIf
Else
If Not EOF(a) Then
iLine$ = ReadLine(a)
EndIf
EndIf
DrawScreen
Goto ViewBook1
But I don't really get how your code is going to work and why you are checking if the file is running out since you start it all over again, when you go to viewbook1. This is how you might want to do, or at least it's my vision of your code.
viewbook1:
Cls
Print ""
Repeat
Search$=Input("Find:")
DrawScreen
Until KeyHit(cbkeyreturn)
CloseInput
a=OpenToRead("People.txt")
While Not EOF(a)
If Search$ = "" Then
iLine$ = ReadLine(a)
Print iLine
EndIf
Wend
WaitKey
closefile a
Goto viewbook1
Well I am trying to get it so that if there is no Search, it lists everything in the file, otherwise, I want it to find a certain string in the file. I can't seem to get it right...