Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!news.iecc.com!.POSTED!nerds-end From: glen herrmannsfeldt Newsgroups: comp.compilers Subject: Re: PL/I exceptions, was catch and throw, was Is multi-level function return possible? Date: Sat, 29 Mar 2014 02:40:24 +0000 (UTC) Organization: Aioe.org NNTP Server Lines: 32 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <14-03-079@comp.compilers> References: <14-03-065@comp.compilers> <14-03-068@comp.compilers> <14-03-070@comp.compilers> <14-03-076@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: miucha.iecc.com 1396062956 10231 2001:470:1f07:1126:0:676f:7373:6970 (29 Mar 2014 03:15:56 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Sat, 29 Mar 2014 03:15:56 +0000 (UTC) Keywords: PL/I, errors, comment Posted-Date: 28 Mar 2014 23:15:55 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:1201 mac 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]