Flow-control structures: Difference between revisions
m
→{{header|Ada}}: added 'return'
m (→exit: added 'exit when') |
m (→{{header|Ada}}: added 'return') |
||
Line 157:
end loop;
end loop Outer;</syntaxhighlight>
===return===
A procedure can be exited early, if there’s no more to be done.
<syntaxhighlight lang="ada">procedure Foo is
begin
-- do something
if Nothing_More_To_Do then
return;
end if;
-- do more
end Foo;</syntaxhighlight>
===asynchronous transfer of control===
|