From: "DuckE" <nospam_steved@pacifier.com>
Subject: Re: Exit Loop_Statement
Date: 2000/05/09
Date: 2000-05-09T00:00:00+00:00 [thread overview]
Message-ID: <3918c6f2.0@news.pacifier.com> (raw)
In-Reply-To: 39181473@news.wa.apana.org.au
"David Freshwater" <dafresh@odyssey.apana.org.au> wrote in message
news:39181473@news.wa.apana.org.au...
> Hi,
> Thanks for the help....I had picked up the (1..3) error.
> I actually have written 2 programs for this assignment. One works well,
the
> other is a different approach to what we have been taught. Let me point
out
> that I am an external student studying this, which makes it hard as I
don't
> have any one to bounce ideas off or get any helpful input. So any help
> whether pointers or snippets of code are really appreciated.
> I do understand the need to do this by myself but it just gets
frustrating.
>
For validating data entry it is sometimes convenient to use a loop that will
not exit until a valid entry is made:
ReadLoop:
loop
begin
Put( "Enter Value > " );
Get( value );
exit ReadLoop when value >= 1 and value <= 10;
exception
when others =>
null;
end;
Put_Line( "Invalid Entry - please enter a value between 1 and 10" );
end loop;
I hope this helps,
SteveD
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 ` David Freshwater
2000-05-09 0:00 ` DuckE [this message]
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 ` Gautier
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Ken Garlington
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