Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TIMER PASS 1 MINUTE 2

Status
Not open for further replies.

blackmagik

Technical User
Mar 22, 2002
5
0
0
US
WHY IS IT THAT I CANT SET MY TIMER PASS 1 MINUTE OR 60999..I NEED TO BE ABLE TO SET IT PASS 1 MINUTE.I GET A INVALID PROPERTY VALUE MESSAGE.PLEASE HELP ME IF U CAN
 
Lower case please. Why is that limit such a surprise? It is in the Docs.
"Setting Description
0 (Default) Disables a Timer control.
1 to 65,535 Sets an interval (in milliseconds) that takes effect when a Timer control's Enabled property is set to True. For example, a value of 10,000 milliseconds equals 10 seconds. The maximum, 65,535 milliseconds, is equivalent to just over 1 minute. "
Most people who need more than 1 minute set an expiration data in a variable and use the timer only to check every so often.
If Now > varaiable Then
Generate Forms/Controls Resizing/Tabbing Class
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
thx for the quick response..i didnt know that but now i do..im new at this..could u please do me a favor and look for my other post it should be close to this 1.. i had a question about using the senkey to hit {~} then type in NETDElAY then {enter} with a timer that will make that command runs every minute..thx in advance
 
If you want your timer to do something say at 5 minutes you can do something like this:

1) create a global variable (ie. DIM TimeToAct As int) and set its value to 0.
2) put a timer on the form and set the timer event at 60000 mS. AKA 1 minute.
3) In the timer event:
TimetoAct = TimeToAct + 1
If TimeToAct = 5 then rem check if 5 minutes
TimeToAct = 0 rem reset counter
do something
End IF

You can set the 5 in the If statement above to any desired number of minutes. You can also use other values for the time event it you want seconds or hours etc.
 
i would luv my timer to run past 1 minute..im sure what you are sayin above is true but im new at this so i cant exatly put 2gather what u mean..how do i add an global group..i know how to add the form then the timer to it and the code to the timer..example please!!
 
Didn't I help you answer the first part of this question, though i can find where in the Forum it went??? It disappeared.

Anyway, If you want to make the timer only click after ## of minutes. You have to do this.

Set your timer to 60,000. So it will now only click on every minute. Then your going to need to see how many minutes have passed.

In the general declarations section of your code. Add the following Line
[tt]
Public lgMin as Long
[/tt]
Then in the code for the Timer add this.

lgMin = lgMin + 1
If lgMin = 5 Then 'Assuming you want to wait 5 minutes
lgMin = 0 'reset this for the next pass
'This is where your Send Keys stuff should be

End If
[/tt]

That should do it. Email me If you need more help. BTW what game was it you played i was going to go out and pick up a new game this weekend, I could do a search for you on Kali if I have your playername.

Craig, mailto:sander@cogeco.ca
"Procrastination is the art of keeping up with yesterday."
I hope my post was helpful!!!
 
Here's a procedure you can use to accomplish this. Just change the value of the constant to be the number of minutes you want to pass between executing your code. The example here executes the code every five minutes. NOTE: Be sure to set your Timer's Interval property to 60000 (1 minute). I hope this helps...


Private Sub Timer1_Timer()

Static lngMinutesPassed As Long

Const c_MinutesToWait = 5

lngMinutesPassed = lngMinutesPassed + 1

' This event fires every minute, see if the proper
' number of minutes has passed.
If lngMinutesPassed < c_MinutesToWait Then
GoTo PROC_EXIT
End If

' We've reached the interval, so reset our counter to 0.
lngMinutesPassed = 0

' Put your code here...

PROC_EXIT:
Exit Sub

End Sub
 
hey, thx for ur example..now i have something to work with..Hey CRAIGSANDERS..yes ur example did help but the post got erased for sum reason..i tried emailin you but the mail returned..im emailin you again..thx guys
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top