Flow-control structures: Difference between revisions

Asynchronous transfer of control added
(→‎goto: Label syntax fixed)
(Asynchronous transfer of control added)
Line 20:
end loop;
end loop;</lang>
===asynchronous transfer of control===
A sequence of operation can be aborted with an asynchronous transfer of control to an alternative:
<lang ada>
select
delay 10.0;
Put_Line ("Cannot finish this in 10s");
then abort
-- do some lengthy calculation
...
end select;
</lang>
The alternative can be a delay statement or else an entry point call followed by a sequence of operations. The statement blocks at the delay or entry call and executes the sequence of the operation introduced by '''then abort'''. If blocking is lifted before completion of the sequence, the sequence is aborted and the control is transferred there.
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Standard - except the Refinement Preprocessor is an extension}}