|
-
Jan 15th, 2005, 06:08 AM
#1
Thread Starter
Member
Newbie Question
Hey,
I am making a program that has a continuous loop, all up the "cycle" takes around 30 seconds, even after I close the program the loop continues to run (seeing as it includes a mouse_event it is quite annoying).
I was wondering how I could add a "Stop" button, that kills all processes the program is running but keeps it open?
Thanks.
-
Jan 15th, 2005, 06:32 AM
#2
Re: Newbie Question
 Originally Posted by Refl3ct
Hey,
I am making a program that has a continuous loop, all up the "cycle" takes around 30 seconds, even after I close the program the loop continues to run (seeing as it includes a mouse_event it is quite annoying).
I was wondering how I could add a "Stop" button, that kills all processes the program is running but keeps it open?
Thanks.
What you need to do is have a varible, like stop (boolen) and then you loop should be like
VB Code:
do until stop = true
'loop stuff
loop
all you have to do is set stop to true when you exit the program
-
Jan 15th, 2005, 06:33 AM
#3
Hyperactive Member
Re: Newbie Question
declare LoopValue variable below the option explicit
On form load event write keyprivew = true
write a procedure in keydown event of form
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF10 Then
LoopValue = 30
endif
End Sub
now call this routine within the loop
-
Jan 15th, 2005, 06:39 AM
#4
Thread Starter
Member
Re: Newbie Question
That doesn't stop it mid-loop. As I said it's a kind of long loop, and I want to be able to stop mid-way through it. (Instantly).
Edit - reading above post.
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
|