Results 1 to 6 of 6

Thread: Loop with an unknown end?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Unhappy

    Okay, I know this makes a loop go for 1000 whatevers.
    Code:
    Dim i as integer
    For i = 1 to 1000
    'all my code in here
    Next i
    But Im making an online game (almost done too ) but I want a loop to keep send my coordinates to the other person, but I don't want to use a timer, because that defeats the purpose of using BitBlt. And I don't know how long each game is going to go on. Anyone got any ideas?

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    You have done a game without any idea how to do that? wow

    ok, heres the idea: Make a loop that runs all the time till you exit the program. There you can make timing with GetTickCount or something and send whatever all the time. Looks like this:

    Code:
    'Declares
    Dim Active as Boolean
    
    'Form_Load
    Active = True
    While Active = True
     'Game comes here ;)
    
     DoEvents
    Wend
    End
    
    'Form_Unload
    Active = False

  3. #3
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    (Don't forget to show the Form before running the loop )

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800

    Wow! To Reply's In Under 2 Minutes!

    Thanks fox, I'll give it a try.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Posts
    1,800
    Oh boy, I must be loosing it, the answers are so easy yet I never find them . Thanks fox!

  6. #6
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    no problem

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