Results 1 to 4 of 4

Thread: Trying to stop my program (Pause)

  1. #1

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217

    Trying to stop my program (Pause)

    I've written a program and I would like the ability to stop everything the program is doing and wait until a start button is clicked.

    Can anyone help me on this???

  2. #2
    Fanatic Member demotivater's Avatar
    Join Date
    Jun 2002
    Location
    is everything
    Posts
    627
    Put a boolean value in the start button, wherever you are in your code you could add an "if boolean = true then..."
    Set the boolean to true when the start button is clicked.
    A few different ways to do something like this, just depends on what your program is doing at the time you want to stop it.
    Here's to us!
    Who's like us?
    Darned few, and they're all dead!

  3. #3
    Fanatic Member laserman's Avatar
    Join Date
    Jan 2002
    Location
    Wales U.K
    Posts
    775
    Is there a Timer involved in the code?

  4. #4

    Thread Starter
    Addicted Member Chrispybee's Avatar
    Join Date
    Sep 2003
    Location
    North Wales, UK
    Posts
    217
    This is my wait routine that I got off here.

    VB Code:
    1. Public Sub Wait(sec As Single)
    2.     Dim tim As Single
    3.     tim = Timer
    4.     While Timer < tim + sec
    5.         DoEvents
    6.     Wend
    7. End Sub
    Usage: wait 1 ' Wait 1 second

    Now there seems to be a bug where after a few days of waiting, it will just hang. Need to shut program down and re-open. Works fine.:mike: :mike: :mike:

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