× 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.



On Thu, Oct 12, 2017 at 3:20 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:


Ah, but it could be!

I can't say what Kevin's tooling does, but if you can wrap a chunk of
code in an artificial DO loop (so that you can use LEAVE), then you
could also (in principle) wrap that same chunk of code in a
subroutine, so that you can use LEAVESR.

Then leave setting the indicator and RETURN in the (syntactic) mainline.

So, something along the lines of

//syntactic mainline
exsr @MAIN;
parm12 = *in12;
return;
...
begsr @MAIN;
//semantic mainline part1
if something LEAVESR
//semantic mainline part2
if somethingelse LEAVESR
//semantic mainline part 3
endsr;

I realize it feels kind of radical to "move" so much code to "the
bottom". But it would be one way to get rid of the GOTOs without
introducing a loop.


​John,

Ordinarily, I hate the idea of a mainline that's just an EXSR / CALLP.​

But as they say, there's no problem in CS that can't be solved by adding
another layer of abstraction.

So this idea has merit.

My only concern from a general standpoint, is if there was a GOTO @END in a
secondary subroutine, LEAVESR won't work, but the EXSR @END_PROGRAM;
would....

Will have to ponder this...

Thanks!
Charles

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.