C+ C Title: CMDSQZ C Author: T. R. Wyant C Date: 13-Oct-1987 C Modified: C Remarks: C Subroutine CMDSQZ uppercases commands, and removes C superflouous blanks. C- SUBROUTINE CMDSQZ (CMDBUF, CMDLEN) LOGICAL*1 CMDBUF (255) ! Command buffer. INTEGER*2 CMDLEN ! Comamnd length. INTEGER*2 CMDLOC ! Current output loc. in cmd. INTEGER*2 COMPRS ! .TRUE. to drop blanks. INTEGER*2 CMDIN ! Current input loc. in cmd. COMPRS = .TRUE. ! Remove leading blanks. CMDLOC = 0 ! Starting at location 0. DO 1090 CMDIN = 1, CMDLEN ! For each character: IF (CMDBUF(CMDIN) .LE. ' ') THEN ! If it's a blank, then IF (.NOT. COMPRS) THEN ! If not compress, CMDLOC = CMDLOC + 1 ! Bump location CMDBUF(CMDLOC) = ' ' ! Store blank COMPRS = .TRUE. ! Start compress END IF ELSE ! If not a blank COMPRS = .FALSE. ! Stop compress. CMDLOC = CMDLOC + 1 ! Bump location IF (CMDBUF(CMDIN) .GE. 'a' .AND. !If lowercase 1 CMDBUF(CMDIN) .LE. 'z') THEN CMDBUF(CMDLOC) = CMDBUF(CMDIN) - 32 ! Uppercase it ELSE CMDBUF(CMDLOC) = CMDBUF(CMDIN) !Else just copy END IF END IF 1090 CONTINUE IF (CMDLOC .GT. 0 .AND. COMPRS) ! Trim trailing blank. 1 CMDLOC = CMDLOC - 1 CMDLEN = CMDLOC ! Return size. RETURN END