Pause during LotusScript agent
There may be instances when you wish to have a little delay in a LotusScript agent. You may wish to give a shell command enough time to execute, for example. This little routine will delay for "n" seconds where "n" is an integer that you pass to the function.What about the built-in NotesTimer class? Our experience shows this class to be a bit difficult to work with, so we chose to write our own subroutine.
Here's the code....
Sub PauseTime(seconds As Integer)
' Wait (loop and do nothing) for "seconds" seconds - used to make sure
' a file system command happened.
Dim start As New NotesDateTime("")
Dim finish As New NotesDateTime("")
Dim elapsedSeconds As Integer
Dim i As Integer
Call start.SetNow
Call finish.SetNow
elapsedSeconds = finish.TimeDifference(start)
While elapsedSeconds < seconds
For i = 1 To 500
' do nothing
Next
Call finish.SetNow
elapsedSeconds = finish.TimeDifference(start)
Wend
End Sub