From: "Ken Garlington" <Ken.Garlington@computer.org>
Subject: Re: Exit Loop_Statement
Date: 2000/05/09
Date: 2000-05-09T00:00:00+00:00 [thread overview]
Message-ID: <PJJR4.9555$wb7.804827@news.flash.net> (raw)
In-Reply-To: 8f7oep$khc$1@enyo.uwa.edu.au
"David Freshwater" <dafresh@cyllene.uwa.edu.au> wrote in message
news:8f7oep$khc$1@enyo.uwa.edu.au...
> Hi All,
> Just a quick question about Exiting a loop. I have an assignment
> where I have to Exit when "Stop" is input as a clients name, which I can
do.
> The problem is that it has to be case insensitive.
One typical approach is to convert both sides of the comparison to a known
case.
> Also I am trying to get
> the exception statement in the Procedure to work to work
What have you tried?
> The Procedure is as follows :
Just out of curiosity, does this line cause the loop to exit under *any*
conditions?
> exit Any_File when Any(I+1).Clients(1..3) = "Stop";
Also, should the loop exit when someone enters sto? How about STOPPER?
> I := I + 1; --Increment counter if name<> STOP
>
> Skip_Line;
> Put("Please enter the number of tickets purchased : ");
> Integer_Io.Get(Item => Any (I + 1).Num_Tickets);
> Put("Please enter the total cost of purchase : $");
> Float_Io.Get(Item => Any (I + 1).Cost_Total);
> New_Line(3);
> Skip_Line;
>
>
> end loop Any_File;
>
> exception
>
> when DATA_ERROR|NUMERIC_ERROR =>
>
>
> Put_Line(" *****************************");
> New_Line;
> Put_Line(" * INCORRECT DATA ENTRY ! *");
> New_Line;
> Put_Line(" * Please re-enter the data *");
> New_Line;
> Put_Line(" *****************************");
> Skip_Line;
> New_Line (2);
>
>
> Save_Data(I, Filename, P_L_C_I_F);
>
> end Buy;
>
> Any help or suggestions would be greatly appreciated.
>
> David
>
>
next prev parent reply other threads:[~2000-05-09 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-09 0:00 Exit Loop_Statement David Freshwater
2000-05-09 0:00 ` John English
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` John English
2000-05-09 0:00 ` John English
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` David Freshwater
2000-05-09 0:00 ` DuckE
2000-05-09 0:00 ` Gautier
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Ken Garlington [this message]
2000-05-10 0:00 ` Jeff Creem
2000-05-10 0:00 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox