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
Procedure mytimer()
Repeat
Delay(2000) ;Sets how often timer is fired off
MessageRequester("tim3r!","tim3r") ;Remember to press ok, else program wont make new msg box..
ForEver
EndProcedure
timer=CreateThread(@mytimer(),"") ;Timer is now created as a thread..
Delay(10000) ; Halt main program for 10 seconds
KillThread(timer) ;Kills the timer..