Results 1 to 9 of 9

Thread: Timer question [SOLVED, thank you]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member hothead's Avatar
    Join Date
    Mar 2002
    Location
    Missouri
    Posts
    692

    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:
    1. Private Sub Timer1_Timer()
    2.     Dim Seconds As Integer
    3.     Seconds = 300
    4.     Do While Seconds > 0
    5.         Seconds = Seconds - 1
    6.     Loop
    7.     If Seconds = 0 Then
    8.         Call CheckMail
    9.         Seconds = 300
    10.     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
  •  



Click Here to Expand Forum to Full Width