Name: jcagle Date: March 28, 2005 at 11:31:36 Pacific Subject: Get Number of DCL parameters OS: OpenVMS CPU/Ram: Unknown
Comment:
Is there a way to get the number of parameters that are being passed into a DCL COM file? My problem is that I want "" to show up as a parameter if it is on the command line. So, I can't simply loop through P1-P8 to count the non-blanks.
I wanted to narrow this down more...to exactly what it is I'm trying to do.
Let's say I have this: $ @DOIT "HELLO" "GOODBYE" ""
I want to be able to determine that there were 3 arguments supplied. The problem I'm having is that I don't know how to distiguish between "" and an argument that isn't there at all. In other words, P3 and P4 are both interpreted as not being there. Any ideas on how to determine that P3 is there but P4 is not?
I solved a similar problem by using dummy values (like a ".") to distinguish between missing and null parameters.
A Pn parameter reading "." would then be interpreted as <null>, where a "" would mean <missing>.
The idea was to later develop some code (using LIB$GET_FOREIGN and some CLI$ routines) but finally I kept the work-around in pure DCL. Never had problems with it.
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE