NotesTimer (LotusScript®)

Represents a mechanism for triggering an event every fixed number of seconds.

Note: This class is not supported in COM.

Containment

Contained by: NotesSession

Properties

Comment

Enabled

Interval

Methods

New

Events

Alarm

Creation

To create a new NotesTimer object, use New.

Syntax

Dim variableName As New NotesTimer( interval [, comment] )

OR

Set notestimer = New NotesTimer( interval [, comment] )

Parameters

interval%

The interval in seconds for calling the event handler for the timer. This parameter sets the Interval property. The interval is not guaranteed; other activities on the computer involving script may delay the event.

comment$

String. Any comment. This parameter sets the Comment property.

Usage

NotesTimer is intended for use in Notes® UI objects and not agents.

Ensure that the NotesTimer object is declared at a global level. If you declare it in a routine such as PostOpen that responds to an event, it is destroyed when the routine exits. Use Dim without the New syntax at the global level and the Set statement in the executable code.

After setting the NotesTimer object, use the On Event statement to establish an event handler for the Alarm event. Then write the event handler as user code. Design the user code such that it completes in a time period less than the NotesTimer object's interval trigger. Unexpected results occur if the user code takes longer to complete than the specified interval.

A new NotesTimer object is enabled by default. You must set the Enabled property to disable the object.

Example