5.7 Exit Statements
1
Syntax
2
Name Resolution Rules
3
Legality Rules
4
Dynamic Semantics
5
6
9 Several nested loops can be exited by
an
exit_statement
that names the outer loop.
Examples
7
Examples of loops with exit statements:
8
for N in 1 .. Max_Num_Items loop
Get_New_Item(New_Item);
Merge_Item(New_Item, Storage_File);
exit when New_Item = Terminal_Item;
end loop;
9
Main_Cycle:
loop
-- initial statements
exit Main_Cycle when Found;
-- final statements
end loop Main_Cycle;
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe