comp.lang.ada
 help / color / mirror / Atom feed
* Raising IO_EXCEPTIONS.END_ERROR in a loop
@ 1997-11-19  0:00 Scott Ingram
  1997-11-19  0:00 ` Stephen Leake
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Ingram @ 1997-11-19  0:00 UTC (permalink / raw)



The following fragment compiles, and even runs correctly through
one iteration but blows up when re-reading a string from standard
input.  The exception that is raised makes me think that the
string variable used is still visible the second time through--
but shouldn't it pass out of existence at the end of the block?
or what am I misunderstanding?

procedure somesuch is
 begin
      loop
         exit when Continue = 'n' or Continue = 'N';
         Get_Variable:
         declare
            Variable_Name : String (1..OS_Line_Length);
            Name_Length : Natural;
         begin --Get_Variable
            Put ("Enter the name of the variable to examine: ");
            Get_Line (Variable_Name, Name_Length);
               Put_Line ("The variable is set to " &
Variable_Name(1..Name_Length));
         end Get_Variable;
         Put ("Examine another (y|Y)? ");
         Get_Immediate (Continue);
      end loop;
   end somesuch;

-- 
Scott Ingram
Sonar Processing and Analysis Laboratory
Johns Hopkins University Applied Physics Laboratory




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1997-11-19  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-19  0:00 Raising IO_EXCEPTIONS.END_ERROR in a loop Scott Ingram
1997-11-19  0:00 ` Stephen Leake
1997-11-19  0:00   ` Scott Ingram

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox