SLEEP

Summary


Sleep is used to interrupt the execution of a process during a given time.

Syntax

   Sleep lead-time

Parameters

Element

Description

Restrictions

lead-time

Integer expression giving the lead-time before the restart of the process execution.

lead-time >=0

Examples

   # Locking of a symbol to modify a sequence number counter; if the sequence counter
   # is already locked, there is a wait of a second before restarting,
   # in order to avoid consuming too much CPU time
    Repeat
       Lock FOLDER
       If fstat <> 0
          
Sleep 1
       Endif
    Until fstat = 0
    [C]FOLDER += 1
    Unlock FOLDER

Description and comments

The Sleep instruction is used to create pauses in a process. After a Sleep, the process pauses for a duration equal to the number of seconds given in the parameter, then continues normally.

A Sleep instruction can not be interrupted by the <BREAK> key.

Associated errors

Error

Description

ERMODE (10)

The argument is not of the numeric type.

Associated keywords

INTER - NOINTER - ONINTGO


SUMMARY


Copyright © Sage 1999 - 2007