LOTUSSCRIPT LANGUAGE


Examples: On Event statement
This code on a Domino form demonstrates using the Alarm event of the NotesTimer class.

REM Globals
Dim elapsedTime As Integer
Dim elapsedTimer As NotesTimer

REM Create a timer with 1-second interval
REM Handler for Alarm event gets call every second
Sub Onload(Source As Notesuidocument)
  Set elapsedTimer = New NotesTimer(1, _
  "Elapsed time since opening document")
  elapsedTime = 0
  On Event Alarm From elapsedTimer _
  Call elapsedTimerHandler
End Sub

REM The handler adds 1 to a global integer
Sub elapsedTimerHandler(Source As NotesTimer)
  elapsedTime = elapsedTime + 1
End Sub

REM This is an action that displays the global integer
Sub Click(Source As Button)
  Messagebox elapsedTime & " seconds",, "Elapsed time"
End Sub

See Also