$ZCMdline

$ZCM[DLINE] contains a string value specifying the "excess" portion of the command line that invoked the GT.M process. By "excess" is meant the portion of the command line excluding the first argument (the VMS command that corresponds to an image). For example, a command line mumps -direct extra1 extra2 causes GT.M to process the command line upto mumps -direct and place the "excess" of the command line, that is "extra1 extra2" in $ZCMDLINE. $ZCMDLINE gives the M routine access to the shell command line input.

When the VMS Command Language Interpreter (CLI) invokes an image with a foreign command, it does not process the "excess" of the command line. GT.M places this part of the command line in $ZCMDLINE. $ZCMDLINE gives the M routine access to any user DCL command line input. The DCL Shell interpretation of the input removes one level of quotes. By default, if the input is not enclosed in quotes (""), the CLI parser forces the input to upper case. M routines cannot modify $ZCMDLINE.

Example:

    $ create test.M
    write $ZCMDLINE
    halt
    $ mumps test
    $ link test
    $ test == "$" + f$parse("TEST.EXE;")
    $ test other information
    OTHER INFORMATION        
    $
    

This creates the program test.M, then compiles and links it. The example then assigns the symbol "test" and invokes "test" as a foreign command. The M program writes out the remaining text from the invoking DCL command line.

Example:

    $ DCL2M :== $'f$parse("BASE.EXE;")
    $ DCL2M PRINT^RPT2
    

This assigns the symbol DCL2M a value that is used to invoke BASE.EXE as a foreign command. Then the example uses DCL2M with the "parameter" PRINT^RPT2. Assuming BASE is a GT.M image, when the image activates, $ZCMDLINE contains PRINT^RPT2.

Example:

    BASE SET XECSTR="SET LEN=$LENGTH($T("_$ZCMDLINE_"))" X XECSTR IF $L($ZCMDLINE),LEN DO @$ZCMDLINE
    If $TEXT() can locate the entryref, this dispatches to a (sub-)routine specified in $ZCMDLINE.