TIMER_DELAY

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:

  • Timer mode - resumes the data entry session after a specified time interval (e.g., 8 hours and 30 minutes)

  • Clock mode - resumes the data entry session at the specified time of day (e.g., 08:30)

The command parameters are as follows:

Hour, Minute and Second:

  • In timer mode, these parameters set the time interval after which the data entry session will resume.

  • In clock mode, these parameters set the time of day at which the data entry session will resume.  Use a 24-hour clock to designate times later than 12:59 P.M.

Style:  Sets the clock mode or timer mode and determines which buttons are available on the timer window.  Valid options for this parameter include:

  • 1 - Use clock mode instead of timer mode.

  • 2 - In timer mode, remove the Pause button from the timer window

  • 4 - In timer mode, remove the Reset button from the timer window

  • 8 - Remove the Run now button from the timer window

  • 16 - Remove the Cancel button from the timer window

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:

  • 0 - Normal timer window

  • 1 - Minimized timer window image\IMG00002.gif

    The end user can click the button to display the normal timer window.

  • 2 - Program status bar

    No buttons are available to the end user.

  • 3 - The timer is completely hidden.  This option is only available for timer mode.

    Caution:
    Using the hidden timer may make your application appear to be unresponsive.

  • 4 - Program status bar (but disables menus)

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.

See also: SLEEP, DOZE, DELAY

The normal timer window (window state 0)

image\IMG00001.gif

Examples

 

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.