From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_05,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,deeb88b0e7eede4f X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Help with Exceptions! Date: 1996/05/09 Message-ID: <4mtiup$73h@news1.delphi.com>#1/1 X-Deja-AN: 153930057 organization: Delphi Internet Services Corporation newsgroups: comp.lang.ada Date: 1996-05-09T00:00:00+00:00 List-Id: >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.