Results 1 to 6 of 6

Thread: Basic looping question...

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    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]
    -----------------------------------------

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    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

  3. #3

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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]
    -----------------------------------------

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    If I understand, then I would just do something like
    VB Code:
    1. Do While (x<5)
    2.  
    3.     If SomeCondition Then Goto Restart
    4.  
    5.  
    6.     x = x + 5
    7.  
    8. Restart:
    9. Loop
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    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]
    -----------------------------------------

  6. #6
    Addicted Member
    Join Date
    Jul 2002
    Location
    Grand Rapids, MI
    Posts
    166
    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
  •  



Click Here to Expand Forum to Full Width