Page 38, program country3.
The Second Edition uses the new Get_Line function in Ada 2005. It is in
the declaration so that the variable S can be allocated according to the
size of the string that is returned. End_Error is now raised in the
declaration, so the exception cannot be handled in the block.
Instead, it is propagated to the enclosing context and the handler
should be in the main subprogram. (Thanks to David Pettersson.)
begin
loop
...
declare -- Block begins here
S: String := Get_Line; -- Size of string from input
begin
...
exception
when Constraint_Error => ...
end; -- Block ends here
end loop;
exception
when End_Error => null;
end Country3;