Flow-control structures: Difference between revisions

Ada
(→‎[[Perl]]: Subsected!)
(Ada)
Line 3:
 
In this task, we document common flow-control structures. One common example of a flow-control structure is the <code>goto</code> construct. Note that [[Conditional Structures]] and [[Loop Structures]] have their own articles.
 
==[[Ada]]==
[[Category:Ada]]
 
===goto===
Top:
Put_Line("Hello, World");
goto Top;
===exit===
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
Outer:
loop
-- do something
loop
-- do something else
exit Outer; -- exits both the inner and outer loops
end loop;
end loop;
 
==[[C plus plus|C++]]==
Anonymous user