common code patterns

Dr. Hawkins dochawk at gmail.com
Thu Aug 10 18:53:45 EDT 2017


On Thu, Aug 10, 2017 at 11:12 AM, Jerry Jensen via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Switch constructs without breaks are almost like having a 21st century
> “goto”. You can really make a mess if you try.


While doing the code for my dissertation,  I actually found that I was
duplicating a good-sized block of code that could be resolved with a GOTO.

I forget the details, but I effectively had multiple entry and exit points
in a recursive problem, and using a GOTO did  something like passing the
alternate entry setup and going straight to the shared  code--but I
couldn't simply do an IF/ELSEIF block due to the entry.

Then again, that was the first GOTO I'd used since MBASIC 5 eliminated the
need to stash setup codes in high line numbers and then return for
performance reasons--so the first time in 20 years or so.

And it was still the (very) late 20th century.

Anyway, I'll remind those who worry about such things that the failure to
provide ENDIF to IF in livecode is inconsistent with the other control
structures.

-- 
Dr. Richard E. Hawkins, Esq.
(702) 508-8462



More information about the use-livecode mailing list