comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Help with Exceptions!
Date: 1996/05/09
Date: 1996-05-09T00:00:00+00:00	[thread overview]
Message-ID: <4mtiup$73h@news1.delphi.com> (raw)


>In some cases, you *do* want to re-execute the same statement. For example,
>if you query the user for a number, and you get something else:
  If the user still enters 'something else' after being asked for a number
17 times, it should be clear that the prompt is not sufficiently clear,
and one might expect the next input to be the user's foot through the
screen.  The recursive solution has the advantage over a loop that it
might give a storage_error or something beforehand, thus saving the cost
of a monitor.
  Or one could abandon the 're-execute the same statement' approach for:
for p in prompt'range loop
  begin
    Put(prompt(p));
    Get ...
    return;
  exception
    when data_error =>
      if p = prompt'last then raise User_Doesnt_Get_It;end if;
  end;
end loop;
with ever more explicit and simple prompts till you give up on the user.




             reply	other threads:[~1996-05-09  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-05-09  0:00 tmoran [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-05-07  0:00 Help with Exceptions! Robert Gelb
1996-05-07  0:00 ` Vincent Smeets
1996-05-07  0:00 ` Steve Howard
1996-05-07  0:00   ` Robert Dewar
     [not found]   ` <4mqio5$a8b@news.sanders.lockheed.com>
1996-05-09  0:00     ` Robert L. Spooner, AD3K
1996-05-10  0:00   ` Jon S Anthony
1996-05-10  0:00     ` Robert A Duff
1996-05-07  0:00 ` John Herro
     [not found] ` <318F94D9.35AB@io.com>
1996-05-10  0:00   ` George F.Rice
1996-05-13  0:00     ` Dave Jones
1996-05-13  0:00   ` Robert I. Eachus
1996-05-14  0:00     ` John Herro
1996-05-14  0:00       ` Robert I. Eachus
1996-05-14  0:00   ` Theodore E. Dennison
1996-05-14  0:00     ` Robert A Duff
1996-05-14  0:00 ` Michel Gauthier
1996-05-14  0:00   ` Robert A Duff
1996-05-15  0:00     ` Norman H. Cohen
1996-05-15  0:00       ` Robert A Duff
1996-05-15  0:00 ` Michel Gauthier
1996-05-16  0:00 ` Jon S Anthony
1996-05-16  0:00   ` Robert A Duff
1996-05-16  0:00 ` Jon S Anthony
replies disabled

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