with ada.text_io;
with ada.Integer_text_io;
with useful;
procedure d is
-- i : integer := 72;
i
: character;
begin
for i in 1..3 loop --
the loop control variable does not require a declaration
ada.Integer_text_io.put (i);
-- ada.text_io.put (i); -- this is not recognized as being a
reference to the character
-- i
declared outside the loop
ada.Integer_text_io.put
(useful.i);
end loop;
-- ada.Integer_text_io.put (i); -- upon exit from a for
loop the loop control variable
-- becomes
undefined
-- ada.Integer_text_io.put (i); -- this i, defined up top is a
separate variable from the
-- loop control
variable i; there
is no way to access this
-- variable i inside
the loop. Access to it is blocked by
-- the loop control variable.
ada.text_io.put
(i);
end d;