Re: PL/I exceptions, was catch and throw, was Is multi-level function return possible?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sat, 29 Mar 2014 02:40:24 +0000 (UTC)

          From comp.compilers

Related articles
Re: Is multi-level function return possible? federation2005@netzero.com (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? rpw3@rpw3.org (2014-03-27)
Re: catch and throw, was Is multi-level function return possible? usenet@bitblocks.com (Bakul Shah) (2014-03-26)
Re: catch and throw, was Is multi-level function return possible? acolvin@efunct.com (mac) (2014-03-28)
Re: PL/I exceptions, was catch and throw, was Is multi-level function gah@ugcs.caltech.edu (glen herrmannsfeldt) (2014-03-29)
Re: PL/I exceptions robin51@dodo.com.au (Robin Vowels) (2014-03-30)
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sat, 29 Mar 2014 02:40:24 +0000 (UTC)
Organization: Aioe.org NNTP Server
References: 14-03-065 14-03-068 14-03-070 14-03-076
Keywords: PL/I, errors, comment
Posted-Date: 28 Mar 2014 23:15:55 EDT

mac <acolvin@efunct.com> wrote:


(snip on PL/I ON units)


> Not quite the same. ON defined a handler invoked at the signal site. It
> could attempt repair and return. more like an interrupt. However, the
> typical handler did a non-local GOTO to bail out, clearing any calls
> between the signal and the gone-to label.


One I remember, but maybe no-one does anymore. You can use ON ENDPAGE
to paginate output. When an attempt is made to print a line past the
end of the page (an attribute of printable output files) the ENDPAGE
ON unit is executed, which skips to the next page and prints any page
headers. Then return and let the output continue.


ENDFILE, on the other hand, (on input files) most likely goes on to
process the data. It might be that you could close the file, open a
new one and continue on. I never tried that.


For CONVERSION, you can test the invalid character, and, if desired,
replace it with a different one.


For SUBSCRIPTRANGE and STRINGRANGE there likely isn't much to do,
maybe just print a message. You could go process something else, but
usually not much point in trying again.


Java's try/catch, on the other hand, does not have the ability
to fix up and continue.


-- glen
[ON ENDPAGE was probably to help convert COBOL report writer programs. It's
in the PL/I standard, not just an IBM-ism. -John]


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.