SUBROUTINE CMHELP(TOKEN,NCHARS) NOLINEUP C C PRINT HELP TEXT (ON UNIT ERUNIT) FOR THE COMMAND IN TOKEN C 1981-OCT-21 - JWB - REVISION 1 C C INPUTS: TOKEN() - CHAR*1 - COMMAND TO BE HELPED C . NCHARS - NUMBER OF CHARACTERS IN TOKEN C OUTPUTS: NONE -- TEXT PRINTED ON UNIT ERUNIT C INCLUDE (SCANLIB.PARAMS) INCLUDE (SCANLIB.CMTABL) C CHARACTER*1 TOKEN(1) INTEGER NCHARS C CHARACTER*1 XCHAR CHARACTER*8 TYPE(4) CHARACTER*14 POSTL LOGICAL SPARE C DATA TYPE / 'Integer' , 'Real' , 'Name' , 'String' / DATA XCHAR / 'X' / C CALL CMLKUP(TOKEN,NCHARS,CMDTBL,1,CMTBSZ, ICMD) IF (ICMD.LE.0) THEN WRITE (ERUNIT,1000) (TOKEN(I),I=1,NCHARS) 1000 FORMAT(' *** HELP: UNRECOGNIZED COMMAND: ',12A1) ELSE WRITE (ERUNIT,1010) 1010 FORMAT(' HELP FOR:') POSTL = 'Positional' IF (CNARGS(ICMD).GT.0) POSTL = 'Non-positional' IF (CNARGS(ICMD).EQ.0) THEN WRITE (ERUNIT,1020) (CMDTBL(I,ICMD),I=1,NAMLEN) 1020 FORMAT(' COMMAND: ',6A1,2X,'(No initial list allowed)') ELSE WRITE (ERUNIT,1030) (CMDTBL(I,ICMD),I=1,NAMLEN) *, IABS(CNARGS(ICMD)),TYPE(CARGTP(ICMD)),POSTL 1030 FORMAT(' COMMAND: ',6A1,' = < List max of ',I3,' entries, ',A8 *,', ',A14,' >') ENDIF DO FOR K=KWSTRT(ICMD),KWSTOP(ICMD) DO (CHECK FOR SPARE) IF (.NOT.SPARE) THEN POSTL = 'Positional' IF (KNARGS(K).GT.0) POSTL = 'Non-positional' IF (KNARGS(K).EQ.0) THEN WRITE (ERUNIT,1050) (KWDTBL(I,K),I=1,NAMLEN) 1050 FORMAT(' KEYWORD: /',6A1,2X,'(No list arguments allowed)') ELSE WRITE (ERUNIT,1060) (KWDTBL(I,K),I=1,NAMLEN), *IABS(KNARGS(K)),TYPE(KARGTP(K)),POSTL 1060 FORMAT(' KEYWORD: /',6A1,' = < List max of ',I3,' entries, ',A8 *,', ',A14,' >') IF (KARGTP(K).EQ.LSTYPN) THEN WRITE (ERUNIT,1070) ((NAMTBL(I,N),I=1,6),N=NMSTRT(K),NMSTOP(K)) 1070 FORMAT(' NAMES: ',9X,7(6A1,:,', ') / 2(20X,7(6A1,:,', '),:/) ) ENDIF ENDIF ENDIF END FOR ENDIF RETURN C C$CCC -------------------------------------------------------------- C PROCEDURE (CHECK FOR SPARE) SPARE = .TRUE. DO FOR I=1,NAMLEN SPARE = SPARE .AND. KWDTBL(I,K).EQ.XCHAR END FOR END PROCEDURE C C$CCC -------------------------------------------------------------- C END