Wrox Programmer Forums
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old June 17th, 2004, 11:49 AM
Friend of Wrox
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default Infinite timer?


I have developed a VB6 exe that I need to use to monitor mail round trip times. It uses outlook and access. I need to run this file every 30 min and it need to run in the Win profile with the outlook profile setup. I have tried the standard windows task scheduler and it does not work for me.

I can work around the profile problem by running it logged into the machine. Any ideas on how to make the program wake up every 30 min (vbs or VB6)?

Reply With Quote
  #2 (permalink)  
Old June 17th, 2004, 02:59 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Let me give you the logic on this.

You can use Timer Control to achieve that.

But the timer control can be set the maximum value of 65 seconds(65535 ms), you got to have a counter that gets incremented by 1 for every min(60000 ms) and finally when the counter reaches 30, you should run the code that needs to monitor mail round trip and reset its value to 0, so that it runs again when it reaches 30.

private Sub Timer1_Timer()
  static nTimes as Long
  If nTimes = 30 then
    ' Execute the code for monitor mail round trip
    nTimes = 0
  End If
End Sub
Set the Interval property of the Timer to 60000.

Hope that helps.

-Vijay G
Strive for Perfection
Reply With Quote

Similar Threads
Thread Thread Starter Forum Replies Last Post
infinite loop smilesmita Pro PHP 1 December 21st, 2007 10:44 AM
problem of infinite loop sarah lee ASP.NET 1.0 and 1.1 Basics 19 December 14th, 2006 09:26 AM
infinite recursion bangbangbogi XSLT 3 May 4th, 2006 05:54 AM
Infinite Loop Detection jtdang77 Classic ASP Basics 0 October 14th, 2003 05:32 PM
Guestbook with infinite page Rolleman Classic ASP Basics 1 September 18th, 2003 10:16 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.