Response Definition
Respond to a specified amount of elapsed time.
[interrupt] response to interval SECONDS
[ACTION_STATEMENT] ...
interrupt
Allow ESL to leave and return to any block currently executing, except a guarded block, when the response is stimulated. ESL will first finish any current action statements from a response in the block, then execute the actions in the interrupt response, and finally return to the block to await a new stimulus from within the original block.
SECONDS
A compile-time integer value between 1 and 32K inclusive, representing the interval, in seconds, before which ESL will execute this response.
ACTION_STATEMENT
An action statement.
Description
A response to interval statement can be specified within a block.
If other actions are taking place while the specified seconds are passing, response to interval will take place after those actions are completed. If the actions exceed the specified interval by two or more times, response to interval will only execute once.
response to interval 0 will produce an error message.
Example
response to interval 60
read file Status into Status_Region
change Clock to time
# The following example shows how you might use an
# integer constant to set certain program defaults which
# can be easily changed by modifying one value only.
# At the top of the program with other constants...
integer constant IntervalOne is 15
...
# Somewhere in one area of the program
begin
response to interval IntervalOne
change Logo position by 10 10
response to char from keyboard
leave block
end
...
# Somewhere in another area of the program
begin
response to interval IntervalOne
if (visibility of Flasher) then
make Flasher invisible
else
make Flasher visible
end if
end
See Also
response to timeout Response Definition