Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[VB2008] How would I make a continuous loop ....

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Wed Mar 12, 2008 10:03 am    Post subject: [VB2008] How would I make a continuous loop .... Reply with quote

How would I turn this code into a continuous loop.
Code:

 Dim i As Integer
        i = 0
        For i = 1 To 5
            MsgBox("Hi")
        Next i


But what if I wanted that loop to only last until button2 is clicked?
Back to top
View user's profile Send private message
Anden100
Grandmaster Cheater
Reputation: 0

Joined: 20 Apr 2007
Posts: 668

PostPosted: Wed Mar 12, 2008 10:11 am    Post subject: Reply with quote

i dont program VB myself, but i would guess, something like this would work:

first, make "i" an variabled, that can be readed from all over the program

then make the first button this:

Quote:
i = 0
For i = 1 To 5
{
MsgBox("Hi")
i = 0
}
Next i


and the second:

Quote:
i = 5


but once again, im not sure...[/quote]
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Wed Mar 12, 2008 10:39 am    Post subject: Reply with quote

While / Do While
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Mar 12, 2008 2:31 pm    Post subject: Reply with quote

Use a timer or create a thread and have the button either turn it off or kill the thread?
_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Michel
Expert Cheater
Reputation: 0

Joined: 16 May 2007
Posts: 214
Location: The Netherlands

PostPosted: Wed Mar 12, 2008 2:35 pm    Post subject: Reply with quote

If you use a timer, just add 'timer1.enabled := false; ' to the button..
Back to top
View user's profile Send private message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Wed Mar 12, 2008 2:43 pm    Post subject: Reply with quote

kk I understand
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites