Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why does my Loop end after 11 Loops?
#9
I'm guessing your program is structured like the following, and that you're looking for something like this?

Code: (Select All)
DIM SHARED AS LONG DataCount, DataItem(4000)
OPEN "someFile.txt" FOR INPUT AS #1
DataCount = 1
Recur

SUB Recur
    IF DataCount = 1 THEN SEEK #1, 1 'move to the start of the file 'may need to change to 0 for 0 index counting
    FOR i = 1 TO 7
        INPUT DataItem(i)
    NEXT
    DataCount = DataCount + 7
    CALL WorkSub
    IF DataCount < 4000 THEN Recur
END SUB

SUB WorkSub
    'work on these specific data items
END SUB


Now, my question here is: Why do we even do a file seek at all here?  There doesn't appear to be any file input at all going on.  It's all being handled with an user INPUT.  Do you actually want to do an INPUT #1, DataItem(i)?
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 SMcNeill - 02-07-2023, 01:40 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exiting sub while inside a loop PhilOfPerth 5 525 12-05-2025, 09:40 AM
Last Post: PhilOfPerth
  Do Loop, Sleep and Mouse Button Dimster 5 599 09-06-2025, 12:57 PM
Last Post: Dimster
  Using modulo to loop through lists fistfullofnails 3 725 09-03-2025, 11:50 PM
Last Post: fistfullofnails
  What is wrong with this for/next loop Helium5793 6 1,158 04-15-2025, 05:11 PM
Last Post: Kernelpanic
  Question on ln in a for/next loop Dimster 13 2,251 09-13-2024, 11:07 PM
Last Post: Kernelpanic

Forum Jump:


Users browsing this thread: 2 Guest(s)