-- Chapter 9 - Program 3 with Text_IO; use Text_IO; procedure Blocks is package Int_IO is new Text_IO.Integer_IO(INTEGER); use Int_IO; Index, Count : INTEGER; begin Index := 27; Count := 33; Put("In the main block - values are"); Put(Index); -- Blocks.Index Put(Count); -- Blocks.Count New_Line; declare Index, Stuff : INTEGER := -345; begin Index := 157; Put("In the embedded block - values are"); Put(Blocks.Index); -- Blocks.Index Put(Index); -- local Index Put(Stuff); -- local Stuff Put(Count); -- Blocks.Count New_Line; end; Put("Back to the main block - values are"); Put(Index); -- Blocks.Index Put(Count); -- Blocks.Count New_Line; Who: -- Block name declare Index, Stuff : INTEGER := -345; begin Index := 157; Put("In the block named Who - values are"); Put(Blocks.Index); -- Blocks.Index Put(Index); -- Who.Index Put(Who.Index); -- Who.Index Put(Stuff); -- Who.Stuff Put(Who.Stuff); -- Who.Stuff Put(Count); -- Blocks.Count New_Line; end Who; Put("Back to the main block - values are"); Put(Index); -- Blocks.Index Put(Count); -- Blocks.Count New_Line; end Blocks; -- Result of execution -- In the main block - values are 27 33 -- In the embedded block - values are 27 157 -345 33 -- Back to the main block - values are 27 33 -- In the block named Who - values are 27 157 157 -345 -345 33 -- Back to the main block - values are 27 33 -- Note; some blanks were removed to fit the data in 70 columns.