[comp.os.vms] checking for valid DCL commands.

LANGFORD@VCUVAX.BITNET (Bob Langford) (06/09/87)

>    Is there a way to check whether a word is a logical or symbol (something
> like DIR*ECTORY or MAIL) without causing errors in DCL?  What I would like
> to do is check a parameter to see if it is a verb/symbol and $symbol if it is
> and $r parameter if it is not.

It is easy to see if a string is the name of a DCL symbol, but I don't know a
way to see if a string is a currently valid command.  However, it is easy to
do the reverse:  find out if the parameter string is the name of an image file.

$ X := f$parse(P2,".EXE")
$ if X .eqs. "" then $goto NoSuchProgram    ! hope it's a command....
$! Else, it is a program.
$ run 'X'         ! or RUN 'P2'

Hope this helps....

P.S.  There was a program called VERB on a past VAX Symposium tape from DECUS
that could extract a command verb definition from DCL's tables.  I suppose
it could be modified to check whether or not a verb is defined....


                              ...Bob...