Domino Code Fragment

Code Name*
How to Have a Script in Notes R4 Pause for Some Time and then Continue
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.188.40.207
Description*
Below are two examples illustrating how to have a script pause for a specified amount of time and
then continue.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Problem:
In Notes R4, how can you have a script pause for a certain amount of time and then continue?

Solution:
Below are two examples illustrating how to have a script pause for a specified amount of time and
then continue.

The first example uses the LotusScript Timer function, and the second example uses the
NotesDateTime class. Both examples include a While loop with a test to determine if 10 seconds
have elapsed. If so, the script leaves the While loop and brings up a message box with the number
of seconds that have elapsed.

Note: When a script is in pause mode, you do not regain access to the Notes client functionality.
Even in pause mode, the script is still running and maintains control of the Notes session.

Example 1

StartTime = Timer ' Timer returns the number of seconds since midnight
Do While StartTime + 10 > Timer
Loop
Messagebox ("The elapsed time is " + Str(Timer - StartTime) + " seconds")

Example 2

Dim Starttime As New NotesDateTime( "" )
Dim Endtime As New NotesDateTime( "" )

Call StartTime.SetNow
Call EndTime.SetNow
While EndTime.TimeDifference( StartTime ) < 10
Call EndTime.SetNow
Wend
Messagebox EndTime.TimeDifference( StartTime)