"Components Used" list and then click Edit Timer.
The UI editor is shown and displays a ready-to-use timer that you can configure.
In the UI editor, select the Timer component (step 1):
Configure the properties of the Timer component (step 2):
Define the action to be executed by the Timer component (step 3). The sole actions useful for timers are Execute PHP code and Execute an HEScript function. Learn more about control actions.
For instance, to configure the timer to execute a PHP script, make sure that this script is available in the application's root folder. Then use the PHP include command:
<?php include('cron.php') ?>
To start a timer component, use the StartTimer function defined in HEScript.
For instance, to start the timer named Timer1, pass its reference (Component Name + Control Name): in our case, it is timer1Timer1
In our example, we want to start this timer when the application starts. In the UserMain script, insert this code:
procedure OnStartMainWindow; begin // When the main window is going to be displayed (just before the homepage is shown). StartTimer("timer1Timer1", 15000); // Start the timer named Timer1 in timer1 component and sets its interval to 15000. end;
Once a timer is started, it won't stop until the application is closed or you stop it with StopTimer.
To stop a timer component, use the StopTimer function defined in HEScript.
procedure StopIt; begin StopTimer("timer1Timer1"); end;