Quote:
Originally Posted by MickGyver
I haven't found one, been looking for the same. Maybe you can use a Goto to jump to a label just outside of the loop? I have no idea if that would "break" anything. Somebody more of an expert on BB will probably answer.
|
I believe with the FOR...NEXT you can just change the value of the looping variable so its condition won't be true again. Didn't try it out, but it should work.
For the while, I end up using another variable on the While condition, and change it when I want to leave the loop.. but this adds a new check every iteration of the loop. There should be some smarter way to do it.
NEW QUESTION:
Is there some way to create an "array of subroutines"?
Like, I have 20 subroutines (each one under a different label), and I want to execute one depending upon the value of a variable.
So instead of using a
Code:
Select AAA
case 0
gosub routine0
case 1
gosub routine1
...
case 19
gosub routine19
End Select
which will be slow as hell (and actually smarter doing somekind of tree structure)
Could I just use something like
Any ideas if its possible to implement something like this?