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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,803d147296719896 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 02 Jun 2007 01:16:03 -0500 From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Puzzling small piece of code - exception block essentially used as goto References: X-Newsreader: Tom's custom newsreader Message-ID: Date: Sat, 02 Jun 2007 01:16:03 -0500 NNTP-Posting-Host: 24.6.140.189 X-Trace: sv3-RU8wTwRY+RsY3yv3rZSTkX8vzNBANC3BYkvlzka22GYuLS6AwnIJotO/MJLjQui+/xtlQELGE2C2W0u!Gh4byqBKvnKo+MmiSDv0nOT7Jz9Lw2AApjyI3rinCQNhApmgVYnwk/E9GcIKMiJ8JRxZZwCW7VV6!1V9M02WLn9CNV2r8DXtVf3k5fZX5 X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.34 Xref: g2news1.google.com comp.lang.ada:16047 Date: 2007-06-02T01:16:03-05:00 List-Id: > What I would like clarification on is when the > exception block ends, where is control returned to? Control isn't "returned" anywhere. It flows to the next statement after the block. In this case the next statement is: > end loop Delta_Beyond_Max_Minutes; > Also, anyone up for the challenge of rewriting this without the > exception handler so the rest of us humans can understand what it's > doing? Assuming that Hour is the only output and Hour_Delta and Still_Looping are not used anywhere else, Set Hour to (approximately) New_Hour. Specifically, if New_Hour is sufficiently close to Hour (ie, New_Hour - Hour fits in the legal range of Hour_Delta), then set Hour := New_Hour. Otherwise, step Hour forward by Max_Hour_Delta, or backward by (Max_Hour_Delta - Relative_Time), as many times as necessary to make New_Hour - Hour fit in that range. It would be helpful to know the range of Hour_Delta and to have some idea what Max_Hour_Delta and Relative_Time might be, to figure out just what the programmer was trying to accomplish.