troubleshooting Question

Stopping code execution with a stop button on a VB6 form

Avatar of bpl5000
bpl5000 asked on
Visual Basic Classic
4 Comments1 Solution217 ViewsLast Modified:
I will be using the following code in a VB6 program to cause the CPU to kick up.  I will have a start and stop button on the form, but I'm not sure how to have the stop button cancel the execution of the code?  Here is the code that will be in the start button sub:

Dim goal
Dim before
Dim x
Dim y
Dim i
goal = 2181818
Do While True
      before = Timer
      For i = 0 to goal
            x = 0.000001
            y = sin(x)
            y = y + 0.00001
      y = y + 0.01

How would I make the stop button work?
Thanks! BPL
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros