>Can the timer be used as a counter? I would like to know if I could set it on to count in seconds and then turn it off and calculate the time between start and stop and record that to a database
You do not need to use a
Timer.
Add two properties to your form, this can be done from the Form menu item on the VFP menu, or programmatically in the Form's
INIT() event using something like:
This.AddProperty( "tStart", DateTime() )
This.AddProperty( "iElapsed", 0 )
Then in a command button
CLICK() event, add:
If This.Caption == "Start" Then
This.Caption = "Stop"
ThisForm.tStart = DateTime()
Else
This.Caption = "Start"
ThisForm.iElapsed = DateTime() - ThisForm.tStart
MessageBox( "Interval = " ;
+ Transform( ThisForm.iElapsed, "9,999.99" ) ;
+ " seconds." )
Endif
Return .T.
censored.