	SUBROUTINE CMPRES(STRING,LENGTH)
C
C	   Routine to remove all blanks from a STRING, pad
C	   the end of the string with blanks and return the
C	   compressed STRING along with its LENGTH (position
C	   of the last non-blank character)
C
C	   By: Mark Holomany     Date: 2-Feb-1984
C
C
	IMPLICIT INTEGER (A-Z)
	CHARACTER STRING*(*)

	PTR = 0

	DO 10 N=1,LEN(STRING)
	IF(STRING(N:N) .EQ. ' ') THEN
	   GO TO 10
	ELSE
	   PTR = PTR + 1
	   STRING(PTR:PTR) = STRING(N:N)
	ENDIF
10	CONTINUE
	LENGTH = PTR
	PTR = PTR + 1
	IF(PTR .LE. LEN(STRING)) STRING(PTR:) = ' '

	RETURN
	END
