SUBROUTINE INSERT (SRC, DST, POS) C C Replace a portion of one string with another C C SRC = source string ended by a zero C DST = destination string ended by a zero C POS = position in destination for source string contents C BYTE SRC(1), DST(1) INTEGER POS C C Scan the destination string for its end C J = 1 10 IF (DST(J) .EQ. 0) GOTO 20 J = J + 1 GOTO 10 C C Copy source into destination at position given C 20 I = 1 30 IF (SRC(I) .EQ. 0) GOTO 40 DST(I+POS-1) = SRC(I) I = I + 1 GOTO 30 C C End destination string if source extends it and return C 40 IF (I .GT. J) DST(J) = 0 RETURN END