DCL provides routines to validate and parse commands, command parameters, qualifiers and qualifier values.
Here's an example...
MNTR_CLD.CLD was extracted from SYS$SYSTEM:MONITOR.EXE using the freeware VERB utility.
This .CLD illustrates how you would use a compiled .CLD file (.OBJ) in a program. Note the use of the keyword "routine". This indicates which routine (entry point?) within your program will be invoked by a specific verb.
To compile a command definition, use the /OBJECT qualifier of the SET COMMAND statement:
$ SET COMMAND filespec/OBJECT[=filespec]
The "=filespec" value expression is optional for the /OBJECT qualifier - the default is to use the name portion of the input command definition filespec. and write the object file in your current default directory.
Then, link the compiled command definition with your program:
$ GCC MYPROG
$ SET COMMAND MYPROG_CLD/OBJECT
$ LINK MYPROG,MYPROG_CLD
Note that at some point in your program, you must execute some code to actually prompt the user for command input. Invoke the CLI$DCL_PARSE function specifying (the address of) LIB$GET_INPUT for both the "parameter" routine and the "prompt" routine. This should allow your program to run successfully on-line or from a DCL procedure (interactively, or in batch). If your program is to be invoked as a "foreign" command, then you can call LIB$GET_FOREIGN and pass the resulting string to CLI$DCL_PARSE for processing. By "remembering" whether or not LIB$GET_FOREIGN returned a non-null string, your program can process a single command from the command line which invoked it, and then exit.
To keep your code "portable", write the command processing portion as a function or subroutine, so that on non-VMS systems, you can substitute your own code (or someone else's) to make up for the lack of DCL on the target non-VMS system.
Home Page Operating Systems Products Specialties Freeware
FreeVMS Page Bulletin Board Contact Us About Us
Tradenames, trademarks, service marks, etc. appearing on this page are the property of their registered owners.
"DJE Systems" is a service mark of David J. Dachtera, doing business
as DJE Systems.
This page Copyright ©1998,1999 by David J. Dachtera, All Rights
Reserved.