Timer in PB?
Posted: Tue Mar 08, 2005 6:09 pm
I would like to know if PB has a timer function for executing code repeatidly after a certain amount of time has eclapsed.
Example:
Example:
Code: Select all
This code is in Liberty BASIC for demestration purposes only!
//create variable to hold how long the user has used the program for this scession
time1 = 0
//create variable to hold how long the program will run per scession
maxtime = 3
/create a timer that will execute the procedure CheckTrial() every 60 seconds
timer 60000, GoSub CheckTrial()
Procedure CheckTrial starts here
Sub CheckTrial()
//add 312 to the variable time1
time1 = time1 + 312
//if the user has used up all his time for this scession
if ((time1 / 312) = maxtime)
//let the user know his time expired
MessageBox("Trial Peroid", "You time has expired", 0, 1, 0)
//and terminate the program
end
//Close If Statement
End If
//Code Procedure
End Sub