|
-
Oct 24th, 2002, 10:11 PM
#1
Thread Starter
PowerPoster
Basic looping question...
IS there a way to restart a loop at some point?
i.e:
Do
:
:
if codition restart loop
:
:
While
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 24th, 2002, 10:14 PM
#2
Like resetting a counter or somethng?
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 24th, 2002, 10:16 PM
#3
Thread Starter
PowerPoster
More about finding a condition and then restarting the loop without processing the remainder of the loop code.
Like a break in C?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 24th, 2002, 10:19 PM
#4
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
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Oct 24th, 2002, 10:20 PM
#5
Thread Starter
PowerPoster
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!
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
Oct 24th, 2002, 11:06 PM
#6
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|