× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I like James' explanation here but I stay more on the Practical side. If I copy a chunk of code or move a chunk of code and there are "GoTo" instructions I must carefully analyze the tags and determine if they also must be moved or if new ones must be created. Failure to do so can break program logic very badly. With a loop that utilizes Leave in addition to a normal exit 'at the bottom' it's very easily portable with essentially no risk to primary program flow.

Translation: I am lazy. :-)

- Larry "DrFranken" Bolhuis

www.frankeni.com
www.iDevCloud.com
www.iInTheCloud.com

On 7/23/2013 7:37 PM, James H. H. Lampert wrote:

Many years ago, there was a level of fanaticism involving structured
programming, combined with a very primitive understanding of it. It was
exemplified in the inordinate popularity of Pascal, which had no concept
of "LEAVE," and only grudgingly included a GOTO.

This primitive understanding assumed, in particular, that under normal
conditions, an indexed loop always runs to completion, and should only
exit early in case of an irrecoverable error. In fact, there's an
obvious exception to this: table look-up. This led to numerous cases in
which programmers were forced to choose between (1) storing the "found"
value and continuing to waste processor resources iterating uselessly
(perhaps at least skipping the "meat" of the loop), (2) substituting a
DOWHILE or DOUNTIL construct, and handling the counter manually, or (3)
using a GOTO.

It's rather telling that when Niklaus Wirth, the ultimate structured
programming maven, designed a language for actual production use (Pascal
was never intended as more than a teaching language), it *did* have a
"LEAVE" (I don't remember, offhand, what it was called).

At any rate, where GOTO allows transfer of control to any labeled
statement (in some languages, like traditional BASIC, all statements
have labels), possibly even including transferring *into* a loop or
inner-block in a way that bypasses any initialization, LEAVE simply
exits the current iterative structure, going "out" the same way it would
normally exit on completion, while ITERATE simply aborts the current
iteration without actually exiting the loop.

--
JHHL


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.