|
-
Feb 16th, 2005, 11:53 PM
#1
Thread Starter
Hyperactive Member
How can I make an event fire every 30 minutes? [RESOLVED]
I believe timers and thread.sleep is for short durations, like under 3 minutes?
How could I control timing of an event to occur after a half hour?
I have never used date/time and am wondering if this is what I should play with to do something like this?
Last edited by gjon; Feb 17th, 2005 at 12:41 AM.
-
Feb 17th, 2005, 12:05 AM
#2
Re: How can I make an event fire every 30 minutes?
Use a timer but declare a static variable to be a counter. increment your counter every
5 mins then when it reaches 30 mins do your stuff.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:07 AM
#3
Thread Starter
Hyperactive Member
Re: How can I make an event fire every 30 minutes?
Ah, so timers can last longer. What is a timers limit in length? 5 Minutes?
-
Feb 17th, 2005, 12:12 AM
#4
Re: How can I make an event fire every 30 minutes?
Actually in .NET timer interval is an Integer so it can hold a value of 2,147,483,647. Sorry I was thinking still in VB6.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:13 AM
#5
Thread Starter
Hyperactive Member
Re: How can I make an event fire every 30 minutes?
Does that mean over 2 hours? Is that right the way I am reading that?
-
Feb 17th, 2005, 12:16 AM
#6
Re: How can I make an event fire every 30 minutes?
I think this is how it goes?
2147483647 / 1000 = 2147483.647 = seconds
2147483.647 / 60 = 35791.394116666666666666666666667 = minutes
35791.394116666666666666666666667 / 60 = 596.52323527777777777777777777767 = hours
596.52323527777777777777777777767 / 24 = 24.855134803240740740740740740733 Days ???
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:20 AM
#7
Re: How can I make an event fire every 30 minutes?
Thats an insane amount of time for an interval.
I entered 2147483648 for an interval and it errored out, but it ran fine for 2147483647.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:20 AM
#8
Thread Starter
Hyperactive Member
Re: How can I make an event fire every 30 minutes?
Thnx so much, that means I can just use a timer. Cool, I've done that before!
Woohoo!
And o ya, I forgot about the 60. Thanks for the info!
-
Feb 17th, 2005, 12:26 AM
#9
Re: How can I make an event fire every 30 minutes? [RESOLVED]
No prob. I knew they increased the Integer to a Long in .NET but it never clicked with me that
the Interval would relate to a Long too 
Glad to have helped.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:33 AM
#10
Thread Starter
Hyperactive Member
Re: How can I make an event fire every 30 minutes? [RESOLVED]
Ugh, how do u multiply something on a line?
Like
VB Code:
tmrLoadPge.Interval = 60000 x timerVariable
Can it be done that way?
timerVariable is a variable that holds how many minutes I want to change to.
60000 is of course 1 minute multiplied to it.
-
Feb 17th, 2005, 12:36 AM
#11
Re: How can I make an event fire every 30 minutes?
VB Code:
tmrLoadPge.Interval = 60000 [b]*[/b] timerVariable

Assuming that your var contains a numeric value.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Feb 17th, 2005, 12:40 AM
#12
Thread Starter
Hyperactive Member
Re: How can I make an event fire every 30 minutes?
Thank you, I had just realized what I was doing wrong; x looks like a variable I am sure. It's *.
Thanks again.
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
|