Manage Learn to apply best practices and optimize your operations.

Force a timed delay in your script code

This tip describes how to force a timed delay in script code.

Many times you may launch a program or process from within script using the 'Shell' command. You really want to wait until you know that the process has run. We all know that the return value only lets us know if it successfully launched the process - not if the process was completed. If you know it takes a period of time to complete that process, add a loop in your script program using the Timer() function to make the script program wait for a periodof time. The Timer function returns the number of seconds since Midnight. The example below launches a bat file and waits for 60 seconds before continuing the script code.


Dim iReturn As Integer
Dim sglTime As Single
Dim sglWait As Single
     
'//launches a bat file     
iReturn = Shell("d:notesftpln.bat")  

'//gets the current  number of seconds since midnight         
sglTime = Timer()
sglWait = sglTime + 60  '//add the number of seconds you want to wait to the sglTime

'//force the system into waiting 60 seconds before continuing 
'//this loop will continue until the current number of seconds is greater than the  'sglwait' value

Do Until sglTime > sglWait      
     sglTime = Timer()
Loop
  

Dig Deeper on Domino Resources - Part 8

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close