An object that initiates a recurring action at preset intervals.

Syntax

[<oRef> =] new Timer( )

<oRef>

A variable or property in which you want to store a reference to the newly created Timer object.

Properties

The following tables list the properties and events of the Timer class. (No methods are associated with this class.) For details on each property, click on the property below.

Property

Default

Description

baseClassName

TIMER

Identifies the object as an instance of the Timer class

className

(TIMER)

Identifies the object as an instance of a custom class. When no custom class exists, defaults to baseClassName

enabled

false

Whether the Timer is active

interval

10

The interval between actions, in seconds

 

Event

Parameters

Description

onTimer

 

Action to take when interval expires

Description

To use a Timer object:

  1. Assign an event handler to the onTimer event.

The Timer object will start counting down time whenever dBASE Plus is idle. When the number of seconds assigned to interval has passed, the Timer object’s onTimer event fires. After the event fires, the Timer object’s internal timer is reset back to the interval, and the countdown repeats.

To disable the timer, set the enabled property to false.

A Timer object counts idle time; that is when dBASE Plus is not doing anything. This includes waiting for input in the Command window or Navigator. If a process, such as an event handler or program, is running, the counter in all active Timer objects is suspended. When the process is complete and dBASE Plus is idle again, the count resumes.