What am I doing wrong?
You are expecting to be able to re-read your file each time you iterate your for loop. But that is not how IO works (in any language).
Files read from beginning to end and then stop.
If you want to re-read your file each time around your for loop, you will need to either:
Ie. Add a line: seek NB_FILE, 0, 0; as the first line inside the for loop.
See seek() for details.
In reply to Re: Help with for loop
by BrowserUk
in thread Help with for loop
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |