d .TITLE IGETCMD SUBROUTINE TO GET THE COMMAND LINE ,; ; SAMPLE SUBROUTINE THAT GETS THE COMMAND LINE AND RETURNS IT TO USER. ; X; THIS IS INVOKED BY THE FOREIGN COMMAND CAPIBILITY OF DCL ; INITIATING THE CALLING IMAGE. THE CALLING IMAGE THEN CALLS ; GETCMD TO PICK UP THE COMMAND LINE IN ITS ENTIRETY. ; ; NOTE THIS ROUTINE ASSUMES THAT THE CALLER CAN DETECT THE END L; OF THE COMMAND LINE. ; ; THE COMMAND LINE IS PASSED BACK AS AN MSATRAN CONVENTION. x; TEXT IN A VECTOR AND A SEPARATE LENGTH DESCRIPTOR ; @; IE: IN THE CALLING PROCESS TERMINAL SESSION OR COMMAND PROC, ; DEFINE THE FOLLOWING COMMAND EQUATE ; l; mycmd :==$'F$LOGICAL("SYS$DISK")'[directory]file ; 4; WHERE: ; mycmd IS THE COMMAND VERB YOU WOULD TO USE TO INVOKE THE PROGRAM ; directory AND file DEFINE WHERE THE IMAGE RESIDES ` ; ; THEN ENTER: ( ; ; mycmd <...data for the program...> ; T ; ;  ; TO OBTAIN THE COMMAND LINE EXECUTE THE FTN CALL: ; ; LENTXT = IGETCMD (CMDTXT,MAXLEN) H ; ; CMDTXT IS BUFFER TO RECIEVE COMMAND LINE ; MAXLEN IS SIZE OF CMDTXT BUFFER IN BYTES t; LENTXT IS SIZE OF RETURNED TEXT IN BYTES ; CMDTXT IS BLANK FILLED TO THE RIGHT IF LENTXT ; PROGRAM ENTRY  PUSHAB L^DESCMD ; ADDRESS OF REQUEST DESCRIPTOR D CALLS #1,G^SYS$CLI ; REQUEST COMMAND LINE FROM CLI ; ; SEND COMMAND LINE TO USER BUFFER p;  CVTWL @MAXLEN(AP),R2 ; GET LEN OF SHORTER AREA 8 CMPW R2,DESCMD+CLI$W_RQSIZE  BLEQ MOV1  MOVW DESCMD+CLI$W_RQSIZE,R2 ; AS LEN TO MOVE dMOV1: MOVW R2,LENSTR ; SEND AS RESULT IN I*2  MOVL DESCMD+CLI$A_RQADDR,R3 ; SRC ADDS FOR MOVE , MOVC5 R2,(R3),FIL,@MAXLEN(AP),@DEST(AP) ; MOVE TEXT  CVTWL LENSTR,R0 ; SET FUNCTION RETURN OF LENGTH  RET ; ALL DONE XFIL: .ASCII / / ; FILL CHARACTER FOR MOVE C5 LENSTR: .WORD 0 ; LENTGH OF STRING  .END