44695Re: [libertybasic] Re: EOF Indicator/GOSUB
- Mar 1, 2012Am 01.03.2012 18:06, schrieb Carl Gundel:
> Is your EOF test immediately after your OPEN statement as your example suggests? It needs to be inside a loop.I am always using a construct like the one below.
'---code start (watch for line wraps)
open FileName$ for input as #file
' code to parse the file and
' fill an array with the collected information
This is secure and easy to understand.
I wouldn't jump around in the code using GOTO or GOSUB, since I never
had a need to do so.
It is always best to collect the information before you use it and fill
an array with it.
This speeds up your program immensely compared to reading one entry at a
time and processing it immediately.
LB 4.04 Pro ... http://www.libertybasic.com/assist.html
LB 4.04 ....... http://www.libertybasic.com/lb404setup.exe
LB Community Wiki .............. http://basic.wikispaces.com/
LB Programmer's Encyclopedia ... http://lbpe.wikispaces.com/
LB Bug Tracker ................. http://libertybasicbugs.wikispaces.com/
Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC
Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM
- << Previous post in topic Next post in topic >>