|
-
Jan 31st, 2000, 06:50 AM
#1
Thread Starter
Lively Member
Help Please I posted a question earlier and got some answers but I still cant get it to work.
I want to call commands 2 to 3 minuits apart. Also I would like them to start over after the last one is done. Here is some of my code if any one could help. Also I need to use other timers.
Private Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End SubPrivate Sub Lump()
Call One
TimeOut 120
Call Two
TimeOut 120
Call Three
TimeOut 120
Call Four
TimeOut 120
Call Five
TimeOut 120
Call Six
TimeOut 120
Call Seven
TimeOut 120
Call Eight
TimeOut 120
Call Nine
TimeOut 120
Call Ten
TimeOut 120
End Sub
-
Jan 31st, 2000, 07:26 AM
#2
Sure. Try something like this:
Code:
Private Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub
Private Sub Lump()
Do
Call One
TimeOut 120
Call Two
TimeOut 120
Call Three
TimeOut 120
Call Four
TimeOut 120
Call Five
TimeOut 120
Call Six
TimeOut 120
Call Seven
TimeOut 120
Call Eight
TimeOut 120
Call Nine
TimeOut 120
Call Ten
TimeOut 120
Loop
End Sub
Then somewhere in the form call your sub routine:
Call Lump
------------------
Serge
Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
-
Jan 31st, 2000, 08:41 AM
#3
Frenzied Member
I may be missing something, but what does sngTimer do? You Dim it as a single, but never increment it. Why even have it?
-
Jan 31st, 2000, 08:43 AM
#4
Oops, you're right.....stupid typo (thats what happens when you type directly into the post)
Code:
Private Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
sngTimer = Timer
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub
Private Sub Lump()
Do
Call One
TimeOut 120
Call Two
TimeOut 120
Call Three
TimeOut 120
Call Four
TimeOut 120
Call Five
TimeOut 120
Call Six
TimeOut 120
Call Seven
TimeOut 120
Call Eight
TimeOut 120
Call Nine
TimeOut 120
Call Ten
TimeOut 120
Loop
End Sub
------------------
Serge
Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 01-31-2000).]
-
Jan 31st, 2000, 11:06 PM
#5
Thread Starter
Lively Member
Thanks for all the help. I do have one more question though. For some reason my other timers don't work properly. could it be because of the TimeOut function? If so how would I fix this?
Thanks again
Originally posted by Serge:
Oops, you're right.....stupid typo (thats what happens when you type directly into the post)
Code:
Private Sub TimeOut(pInterval As Single)
Dim sngTimer As Single
sngTimer = Timer
Do While Timer < sngTimer + pInterval
DoEvents
Loop
End Sub
Private Sub Lump()
Do
Call One
TimeOut 120
Call Two
TimeOut 120
Call Three
TimeOut 120
Call Four
TimeOut 120
Call Five
TimeOut 120
Call Six
TimeOut 120
Call Seven
TimeOut 120
Call Eight
TimeOut 120
Call Nine
TimeOut 120
Call Ten
TimeOut 120
Loop
End Sub
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
|