IS there a way to restart a loop at some point?
i.e:
Do
:
:
if codition restart loop
:
:
While
Printable View
IS there a way to restart a loop at some point?
i.e:
Do
:
:
if codition restart loop
:
:
While
Like resetting a counter or somethng?
More about finding a condition and then restarting the loop without processing the remainder of the loop code.
Like a break in C?
If I understand, then I would just do something like
VB Code:
Do While (x<5) If SomeCondition Then Goto Restart x = x + 5 Restart: Loop
Figured that would be the answer. Hoping I could avoid GoTo. Oh well, **** happens, and I think I've blown a neural fuse. Goto it is! :D
i guess this is a little late, but just a thought. I don't even know that it would work but couldn't you do something like
Do While (x<5)
If SomeCondition Then Loop
x = x + 5
Loop
or will that produce errors? i can't try it at the moment. i'm just curious.