You specify the response to interval statement when you want one or more actions to occur every n seconds during the execution of an ESL program, or of any block within it.
In the following example, information in Status_Region is flashed on the screen every 60 seconds, and the time is updated.
response to interval 60
read file Status into Status_Region
change Clock to time
If other actions are taking place while the specified seconds have elapsed, response to interval takes place after the previous actions are completed. If the previous actions exceed the specified interval two or more times, response to interval responds to the last interval only.
A response to interval statement can be specified within a block. The following example shows two response to interval statements, one inside Block_1 and one in the main program. When the program is in Block_1, only the response to interval 15 is valid.
response to interval 60
...
response to Main_Menu
begin guarded Block_1
response to Restart
enable Open_Menu
leave block
response to interval 15
add to Timer
pattern Graphics
end Block_1
If Block_1 was not guarded and Main_Menu was selected, the response to interval 15 would occur until 60 seconds passed; then the response to interval 60 would occur, causing Block_1 to be exited.