Flow-control structures: Difference between revisions
Content added Content deleted
m (→exit: added 'exit when') |
m (→{{header|Ada}}: added 'return') |
||
Line 157: | Line 157: | ||
end loop; |
end loop; |
||
end loop Outer;</syntaxhighlight> |
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=== |
===asynchronous transfer of control=== |