PDA

Click to See Complete Forum and Search --> : Timer/thread/pulse or sumthing


XMortal
Nov 30th, 1999, 08:27 AM
Im looking for a way to increment a variable at a constant rate according to how long the program has been running, i know it must be possible to access the clock or possibly a thread like in java but i have no idea how

specifically, im trying to move from one position in an array to the next each second or less( strange i know but theres a purpose) but it needs to affect the position of a picture as well, problably thru
pic1.left = xpos(i)
pic1.top = ypos(j)
or similar

any help on this would be appreciated

Mark Sreeves
Nov 30th, 1999, 03:08 PM
Can you use a Timer control for this?

------------------
Mark Sreeves
Analyst Programmer

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

razzaj
Nov 30th, 1999, 03:28 PM
well as mark said , u must use a timer control here is some code :

Private Sub Form_Load()
Timer1.Interval = 1000 ' set the timer interval in milliseconds which means each 1000milliseconds ( 1 second) the sub timer1_timer will be accessed

Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
Static x As Long
x = x + 1
Text1 = x
' pretty straight forward
End Sub

- regards -
- razzaj -