Syntax |
Example |
Description/Remarks |
TIMER_DELAY Hour, Minute, Second, Style, Window_State, X_location, Y_location |
See below for examples |
Halts the data entry session and waits for the timer to expire before it allows the session to resume. You can allow users to view the timer countdown, pause and resume the timer, cancel or run immediately, and reset the timer. The timer can be configured for one of two modes:
The command parameters are as follows: Hour, Minute and Second:
Style: Sets the clock mode or timer mode and determines which buttons are available on the timer window. Valid options for this parameter include:
To choose multiple options, add the numbers together. For example, you could hide all of the buttons by using a style value of 30 (2+ 4+ 8+16). Window state: Determines how the timer will be displayed to the end user. Valid options for this parameter are:
An example of when you might use 4 instead of 2 is when you have a template that is in a tight loop checking for files. Pressing F8 to stop the template does not work in mode 2, but will work in mode 4. The disadvantage of using mode 4 is that not all the menus will be available. If there is a lot of ongoing screen activity, mode 2 will respond sufficiently to the F8. X_location - Horizontal placement of the timer window. To center the timer window horizontally, set this option to -1. Y_location - Vertical placement of the timer window. To center the timer window vertically, set this option to -1.
This command returns 1 if the timer expires or the user clicks the Run now button and returns 0 if the timer is cancelled. In addition, this command sets the value of MyNVar "TD_RunNow" to 0 when the timer is displayed, and if the user clicks the Run now button it sets the value of MyNVar "TD_RunNow" to 1. To change the labels on the Run now and Cancel buttons, use the TEXT_OPT command before executing the TIMER_DELAY command. |
The normal timer window (window state 0)
Pause - stops the timer countdown, displays the time remaining, and changes to Resume.
When the user clicks Resume, the timer countdown continues and the button changes back to Pause.
This button is only available for timer mode.
Reset - restarts the countdown from the original value specified in the TIMER_DELAY command. This button is only available for timer mode.
Run now - resumes the data entry session immediately and returns 1.
Cancel - resumes the data entry session immediately and returns 0.
|
Results:
|
|||||||
TIMER_DELAY |
0, |
0, |
15, |
0, |
0, |
-1, |
-1 |
Normal timer window with all buttons, centered on the screen, with a start time of fifteen seconds. |
TIMER_DELAY |
1, |
0, |
0, |
0, |
0, |
-1, |
0 |
Normal timer window with all buttons, centered at the top of the screen, with a start time of one hour. |
TIMER_DELAY |
0, |
5, |
0, |
30, |
0, |
0, |
-1 |
Normal timer window with no buttons, centered on the left side of the screen, with a start time of five minutes. |
TIMER_DELAY |
0, |
0, |
15, |
0, |
1, |
-1, |
-1 |
Minimized timer window with a start time of fifteen seconds. If restored to full size, it will show all buttons and be centered on the screen. |
TIMER_DELAY |
0, |
5, |
0, |
6, |
1, |
0, |
0 |
Minimized timer window with a start time of five minutes. If restored to full size, it will appear in the upper left corner of the screen, and the Pause and Reset buttons will not be shown. |
TIMER_DELAY |
9, |
15, |
0, |
1, |
0, |
-1, |
-1 |
Normal timer window with all buttons, centered on the screen, counting down to 9:15 A.M. |
TIMER_DELAY |
15, |
30, |
0, |
7, |
1, |
-1, |
-1 |
Minimized timer window counting down to 3:30 P.M. If restored to full size, it will appear centered on the screen, and the Pause and Reset buttons will not be shown. |
TIMER_DELAY |
0, |
0, |
15, |
0, |
2, |
-1, |
-1 |
Timer in the program status bar, with a start time of 15 seconds. |
TIMER_DELAY |
9, |
15, |
0, |
1, |
2, |
-1, |
-1 |
Timer in the program status bar, counting down to 9:15 A.M. |
TIMER_DELAY |
0, |
0, |
5, |
0, |
3, |
-1, |
-1 |
Hidden timer stops template execution for 5 seconds. |