Flow-control structures: Difference between revisions

m
→‎exit: Added the loop end name
(Add page to "Flow control" category.)
m (→‎exit: Added the loop end name)
Line 139:
Exit is used to break out of loops. Exit can be used with a label to break out of an inner loop to an outer loop and its enclosing outer loop
<syntaxhighlight lang="ada">Outer:
loop
-- do something else
loop
-- do something else
exit Outer; -- exits both the inner and outer loops
end loop;
-- do something else
end loop Outer;</syntaxhighlight>
exit Outer; -- exits both the inner and outer loops
 
end loop;
end loop;</syntaxhighlight>
===asynchronous transfer of control===
A sequence of operation can be aborted with an asynchronous transfer of control to an alternative:
6

edits