DELAY


DELAY({'RATE',rate_table_number}[,uti_name])
      {fixed_time}
      {random_function}

Where

rate_table_number is either an integer constant or an arithmetic expression involving only integer constants. It must be from 0 to 255. fixed_time is an integer expression with a value from 0 to 2147483647.

random_function is a RANDOM function. See RANDOM for the syntax of this function.

uti_name is a string constant expression that is the name of a UTI statement in the network definition.
Note: The name of the network-level UTI is NTWRKUTI.

Function

The DELAY statement specifies the delay after the next transmit by a simulated terminal. The value specified in this statement will override the default delay for the terminal (specified with the DELAY operand for the terminal in the network definition).

The actual delay (in hundredths of seconds) will be the delay value specified in this statement multiplied by the terminal's UTI value or by the value of the named UTI that you specify as an argument. This value applies to the RATE, fixed time, and random number specifications.

If you specify a single integer constant expression, that integer will be the delay value.

If the first argument is 'RATE', the delay value is chosen randomly from the rate table on the RATE statement referenced by the following integer constant. The RATE statement is a network definition statement.

If you use a RANDOM function as an argument, the resulting random number is used as the delay value.

Examples

exdelay: msgtxt
say 'setting delay 1' tod()
delay(5)                    /* Set a delay of 5 times              */
                            /* the UTI value for message 2.        */
type 'Message 1'
transmit
say 'setting delay 2' tod()
delay(random(1,10))        /* Set a delay of a random number from  */
type 'Message 2'           /* 1 to 10 multiplied by the UTI value  */
                           /* for message 3.                       */
transmit
type 'Message 3'
transmit
endtxt

Note

This statement affects only the delay immediately following the next interruption of STL processing (normally a Transmit Interrupt). In other words, message 1 is sent with the default delay. Then, the five second delay takes effect before resuming program execution, causing message 2 to be sent. Subsequent delays revert to the default delay for the terminal until another DELAY statement is coded.