VB count/wait/timeout script

Soldato
Joined
25 Jul 2006
Posts
3,529
Location
Taunton
im not sure which one i need, i just need a program to automatically do task after 30seconds, but im not sure which one i need, nor do i know the script for such a thing.

i have tried
Code:
wscript.sleep 30000
that didnt work

i also tried
Code:
' Add Timer1 to form
' .Interval=60000 (this can be set to 1000 to count seconds instead)
' .Enabled=False
'Add public variables
' Public CurrentMinute As Single
' Public TimeLimit As Single
'
' Activate timer to begin counting off minutes
'
Private Sub Timer1_Timer()
CurrentMinute=CurrentMinute+1
If CurrentMinute=TimeLimit Then
Timer1.Enabled=False
MsgBox "Time's Up": 'put code to execute other code, here
End If
End Sub
'
' Initialize variables
'
Private Sub Form_Load()
CurrentMinute = 0
TimeLimit=15
End Sub
and that didnt work.

please help!
 
Why not put the code you want to execute after 30 seconds into the Timer() event of a timer set to an interval of 30 seconds? Also where are you trying to do this in a vbscript or in vb6?
 
well im only just starting to learn how to use the software so i dont know much about it, and yes im am using vb6, though i do believe my dad has bought 2005.

thanks again
 
In VB6 if you want the timer to execute something every 30 seconds just set the timers interval to 30000 and put the code you want executing the in timer event handler.

TrUz
 
In VB6, drag a timer off the general toolbar onto your form, in the properties of the timer, set the interval to 30000.

If you then double click on the timer VB will automatically create the code to handle the Timer event which should look like this:-

Code:
Private Sub Timer1_Timer()

'Put code here that you want to execute every 30 seconds

End Sub
 
posting in my Computing lesson :( quite boring, doing VB6 here as well tbh.

Whats so wrong with it? :o
 
Mr^B said:
Just about everything.

:)
To copy a GD "saying":
wormshe9.png


This is not the place or the time; it's just trolling.
 
Last edited:
Back
Top Bottom