|
-
Nov 27th, 2002, 02:32 PM
#1
Thread Starter
Fanatic Member
Timer question [SOLVED, thank you]
Ok, I have a check box, and when that checkbox is enabled, it autochecks my E-mail every 5 minutes. I multiply that by 60, and then multiply it again by 1000 to get the number of milliseconds in 5 minutes, and use the total as the timer interval.
5 * 60 = 300
300 * 1000 = 300000
However, when I run the program, I get an error message saying that the interval variable is invalid, I guess the value is too large for the timer to handle, so I tried using it as a countdown timer, counting down from 300 seconds.
VB Code:
Private Sub Timer1_Timer()
Dim Seconds As Integer
Seconds = 300
Do While Seconds > 0
Seconds = Seconds - 1
Loop
If Seconds = 0 Then
Call CheckMail
Seconds = 300
End If
While testing the code, I found that the program will execute CheckMail immediately, without making any calls to the timer process. I had a small bit of code that would have fixed this problem. It's inside my "Learn Visual Basic 6" E-book, and I think it's covered in Chapter 2 or 3, I can't remember which. However, I don't have it readily available to me, as it's on a CD that my dad uses for work, and I can't remember it offhand. Guess it kinda serves me right for allowing my dad to burn my CD's, he also burns other stuff that he wants/needs.
Last edited by hothead; Nov 27th, 2002 at 04:26 PM.
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
|