Why does my Loop end after 11 Loops?
#2
Your code has something fundamentally wrong. You should check "EOF()" after every "INPUT" preferably because the program could suddenly end with "input past end" error with is irritating. There's no need for recursion, simply count the number of items that were read from the file. Do away with the "FOR... NEXT" loop which is a source of confusion. Put the counter inside the "DO WHILE NOT EOF()... LOOP" and keep checking for how many items to acquire. The program could perhaps offer a warning after it closes the file, if it couldn't get seven items in the last pass.

Why do you need a "SEEK" statement? That is one thing that is bombing your algorithm. "DataCount" needs to be declared as "DIM SHARED", or as "STATIC" inside the subprogram "Recur" and a condition to set it to zero before the processing. Otherwise, as I've said, recursion is not needed for this.
Reply


Messages In This Thread
Why does my Loop end after 11 Loops? - by Dimster - 02-06-2023, 07:08 PM
RE: Why does my Loop end after 11 Loops? - by mnrvovrfc - 02-06-2023, 07:31 PM



Users browsing this thread: 13 Guest(s)