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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e34524ff567b8b1 X-Google-Attributes: gid103376,public From: "Michael F. Yoder" Subject: Re: GOTO in ADA Date: 1999/08/19 Message-ID: <37BC2E9E.4D4EF69C@decada.zko.dec.com>#1/1 X-Deja-AN: 515825289 Content-Transfer-Encoding: 7bit References: <6A08418D0DAA75E0.E4D1854DB5A80C85.B4B03E27B8C9304C@lp.airnews.net> Organization: Compaq Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-08-19T00:00:00+00:00 List-Id: Ray wrote: > > I know that the use of GOTO statements are anathema to most diehard > structured programmers, but can someone give an example of a valid use > of the GOTO in "real life" code? If you are writing a dialog which asks many questions, and want to re-ask one (e.g. because of an error), "goto Ask_Password;" is IMO clearer than writing "loop... exit when Password_OK; end loop;" or whatever. This is particularly so in cases where a straightforward use of loops would make them overlap, for example when the flow of control looks like this: ... ... ... -- Michael F. Yoder Unscientific man is beset by a deplorable desire to have been right. The scientist is distinguished by a desire to *be* right. -- W.V. Quine