[Info-vax] /END=label
Marc Van Dyck
marc.gr.vandyck at invalid.skynet.be
Fri Aug 31 11:42:14 EDT 2018
osuvman50 at gmail.com laid this down on his screen :
> On Monday, August 27, 2018 at 7:21:53 AM UTC-4, John Reagan wrote:
>> On Monday, August 27, 2018 at 2:56:56 AM UTC-4, Marc Van Dyck wrote:
>>> 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 ?
>>>
>>> --
>>> Marc Van Dyck
>>
>> The best you have it write a program that uses LIB$GET_SYMBOL,
>> LIB$SET_SYMBOL, and/or return something via $STATUS and then have the DCL
>> query the symbol and branch as desired. A program cannot control DCL's
>> command processing flow from inside the program.
> The program can exit via LIB$DO_COMMAND with the command being a GOTO
> statement.
Setting return value in $STATUS is what I do right now. But there is
unfortunately no way in DCL to test a condition rather than hardcoding
the numerical value returned by $STATUS in the code. This I find rather
ugly.
But the suggestion of using lib$do_command seems indeed a possibility.
I will try that, although I'm not sure it will work. I would have
appreciated to receive an explanation about how $ READ does it...
--
Marc Van Dyck
More information about the Info-vax
mailing list