[Info-vax] /END=label

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Mon Aug 27 12:57:49 EDT 2018


On 2018-08-27 06:56:47 +0000, Marc Van Dyck said:

> One last question - for now - maybe...
> 
> In the DCL READ command, there is a qualifier /END that branches the 
> current procedure to a label if an end of file condition has been 
> reached.
> 
> Is there a - possibly undocumented - way to implement something similar 
> in a user-written program implemented as a DCL command ?

Try lib$do_command, though I shudder at suggesting that, and haven't 
tried that for this usage.  Emit a GOTO command, if that wasn't 
obvious.  And I haven't tried this particular abomination.

Otherwise, patch DCL to add this feature, and Bob's your uncle.

More commonly?   Return the usual condition status, or return a symbol 
or maybe (ugh) return a logical name.

Or return a symbol containing a label and then jump "through" the 
returned symbol with a GOTO, if you want to twist together the flow 
control of the executable and the DCL interpreter within your own code.

Or invert the application logic, and have the executable or a main 
written in Python, Perl, Lua or some other scripting language process 
the application activities, and have that scripting code or the 
executables summon DCL routines when and if necessary.  I shudder at 
suggesting the emission of a DCL command and the direct execution of 
that command, but it wouldn't surprise me to find some code that did 
that.   Or the aforementioned and entirely cringe-worthy usage of 
lib$do_command.


On 2018-08-27 12:18:55 +0000, Marc Van Dyck said:

> But I find the /END=label method much more elegant...

In terms of its general elegance, DCL is closer to a clown car than to 
a town car.  It was pretty good for the 1970s and 1980s, but 
expectations and requirements have changed in the ensuing decades.

The limits and foibles of DCL have been repeatedly discussed around 
here, though the related remediations and potential wholesale 
replacement are undoubtedly far down the schedule for the folks at VSI.

I write this having just slammed into the 32-bit signed integer 
limitations and the omission of floating point within DCL.  Again.  No 
64-bit integer support, no unsigned integer support, no floating point 
support, no arbitrary-precision support, no object support, no UTF-8 
encoding support, problematic local language support at best, no access 
into iconv nor into the IANA/Olson zoneinfo database, no 64-bit CLI API 
support, grafted-on piping support, etc.



-- 
Pure Personal Opinion | HoffmanLabs LLC 




More information about the Info-vax mailing list