Feature request - more flexible EachIn

BlitzMax Forums/BlitzMax Programming/Feature request - more flexible EachIn

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

I would like to request that the EachIn command be made a bit more flexible so that it doesn't just go through every single item in an array, but instead lets you define where in the array to start and where to end. (or how many items to do?)

Given that, in code, this command probably gets the array size as a loopcounter, that number could easily be adjusted to something less than the size of the array. Also since it probably maintains a memory address which is incremented, it could easily be initialized to a different location in the array rather than the base of it.

Something like....

For counter=EachIn myarray[7] To 16

or

For counter=EachIn myarray[7] To myarray[16]

Also it would be nice to be able to manually adjust the `loopcounter` from within the loop, like you can with a regular For-Next loop, so that you can jump about in the array if needed, something like:

counter2=0
For counter=EachIn myarray
if counter2=5 then NextIn(5) 'ie skip forward 5 elements
if counter2=15 then PrevIn(5) 'ie skip backward 5 elements
if counter2=10 then DirectIn(2) 'Goto element 2
counter2:+1
next counter

something like that, so you can manipulate where you are in the array? Would be real useful to be able to jump forward, backward, and to any given position.

Anyway, just an idea. Would be useful to me.