|
-
Sep 13th, 2000, 10:51 PM
#1
Thread Starter
New Member
Hello Guys,
I need some help in vb programming.
I need to call a function in my application per 5 minutes
(or some other period). How can I do that?
-
Sep 13th, 2000, 10:58 PM
#2
Hyperactive Member
Use a timer control and a module variable
I think from memory Timer controls will let you fire off an event every n milliseconds where 0 < n <= 60000. IN other words, one minute is the most you can get.
So you simply have a module variable in your code or even a static var in your timer event to record how many lots of one minute have passed.
Have you ever seen or used the timer control before?
Regards
Paul Lewis
-
Sep 13th, 2000, 11:06 PM
#3
Fanatic Member
Try this
http://forums.vb-world.net/showthrea...threadid=20868
This question has been asked lots of times, you should try a search of the forum!
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Sep 13th, 2000, 11:09 PM
#4
Fanatic Member
Depends on what your program is designed to do...but you can use the sleep API.
Code:
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
'Then this will put the program to sleep for 5 minutes.
Sleep 300000
But if you want other things to continue on while the program waits the five minutes you would have to use a timer like Paul suggested.
Gl,
D!m
-
Sep 13th, 2000, 11:50 PM
#5
Thread Starter
New Member
How to use timer control
I wnat other things to continue. So I prefer using the
timer, like Paul suggested. But I never used timer control
before, how to use it, and what is the module variable?
Thanks a lot for your answer.
-
Sep 13th, 2000, 11:59 PM
#6
Hyperactive Member
Follow the blue link
not exactly alice in wonderland but if you follow the link that Paul Dwyer placed in his reply, you should see plenty of examples on how to solve your problem.
Regards
Paul Lewis
-
Sep 14th, 2000, 12:07 AM
#7
Thread Starter
New Member
Yes,I got it.
Thank you very much.
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
|