      INTEGER FUNCTION LEN(STRNG)
      IMPLICIT NONE
      INTEGER IPTR
      CHARACTER*1 STRNG(40)
      IPTR = 1
95001 CONTINUE
      IF (STRNG(IPTR).EQ.CHAR(126)) GOTO 95002
      IF (STRNG(IPTR).EQ.CHAR(0)) GOTO 95002
      IPTR = IPTR + 1
      GOTO 95001
95002 CONTINUE
      STRNG(IPTR) = CHAR(0)
      LEN = IPTR - 1
      RETURN
      END
