      SUBROUTINE MAIN
      LOGICAL*1 BUF(512)
      INTEGER GETARG, OPEN
      INTEGER I
      CALL QUERY(25Husage:  cpress [file] ...)
      I=1
23000 CONTINUE
      IF (.NOT.(GETARG(I,BUF,512) .EQ. -1))GOTO 23003
      IF (.NOT.(I .NE. 1))GOTO 23005
      GOTO 23002
23005 CONTINUE
      INT = 1
      GOTO 23004
23003 CONTINUE
      IF (.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .EQ. 0))GOTO 23007
      INT = 1
      GOTO 23008
23007 CONTINUE
      INT = OPEN(BUF,1)
      IF (.NOT.(INT .EQ. -3))GOTO 23009
      CALL CANT(BUF)
23009 CONTINUE
23008 CONTINUE
23004 CONTINUE
      CALL PRESS (INT)
      IF (.NOT.(INT .NE. 1))GOTO 23011
      CALL CLOSE(INT)
23011 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      RETURN
      END
      SUBROUTINE PRESS (INT)
      LOGICAL*1 GETCH
      LOGICAL*1 BUF(92), C, LASTC
      INTEGER INT, NREP, NSAVE
      NSAVE = 0
      LASTC=GETCH(LASTC,INT)
23013 IF (.NOT.(LASTC .NE. -1))GOTO 23015
      NREP=1
23016 IF (.NOT.(GETCH(C,INT) .EQ. LASTC))GOTO 23018
      IF (.NOT.(NREP .GE. 92))GOTO 23019
      GOTO 23018
23019 CONTINUE
23017 NREP = NREP + 1
      GOTO 23016
23018 CONTINUE
      IF (.NOT.(NREP .LT. 4))GOTO 23021
23023 IF (.NOT.(NREP .GT. 0))GOTO 23025
      NSAVE = NSAVE + 1
      BUF(NSAVE) = LASTC
      IF (.NOT.(NSAVE .GE. 92))GOTO 23026
      CALL PUTBUF(BUF, NSAVE)
23026 CONTINUE
23024 NREP = NREP - 1
      GOTO 23023
23025 CONTINUE
      GOTO 23022
23021 CONTINUE
      CALL PUTBUF(BUF, NSAVE)
      CALL PUTCH(125,2)
      CALL PUTCH(LASTC,2)
      CALL PUTCNT(NREP)
23022 CONTINUE
23014 LASTC = C
      GOTO 23013
23015 CONTINUE
      CALL PUTBUF(BUF, NSAVE)
      RETURN
      END
      SUBROUTINE PUTBUF(BUF, NSAVE)
      LOGICAL*1 BUF(92)
      INTEGER I, NSAVE
      IF (.NOT.(NSAVE .GT. 0))GOTO 23028
      CALL PUTCNT(NSAVE)
      I=1
23030 IF (.NOT.(I.LE.NSAVE))GOTO 23032
      CALL PUTCH(BUF(I),2)
23031 I=I+1
      GOTO 23030
23032 CONTINUE
23028 CONTINUE
      NSAVE = 0
      RETURN
      END
      SUBROUTINE PUTCNT(INT)
      INTEGER INT
      LOGICAL*1 C
      C = INT + 32
      CALL PUTCH(C,2)
      RETURN
      END
