SUBROUTINE SCRNCH(STRNG,LNGTH) C C Remove spaces from an ASCII string. C Except for leading spaces on the first field, the first space C encountered is replaced by a comma and then any following C spaces are discarded. If a comma already precedes the C space(s) in the input string, no additional comma is C inserted. C INTEGER LENGTH,I,LASTN BYTE STRNG(1) I = LEN(STRNG) 10 I = I - 1 IF(I .LE. 0) GO TO 40 IF(STRNG(I) .NE. ' ') GO TO 10 LASTN = I + 1 20 I = I - 1 IF(I .EQ. 0) GO TO 30 IF(STRNG(I) .EQ. ' ') GO TO 20 IF(STRNG(I) .EQ. ',') GO TO 30 I = I + 1 STRNG(I) = ',' 30 IF(LASTN .NE. I+1) CALL SCOPY(STRNG(LASTN),STRNG(I+1)) GO TO 10 40 LNGTH = LEN(STRNG) RETURN END