SUBROUTINE REPEAT (INSTR, OUTSTR, IRPT, ILEN) C***************************************************************************** C C Description : Concatenates a specified string with itself to produce the C indicated number of copies. The resulting string is placed C in a specified array C C Arguments : INSTR = STRING, containing the string to be repeated, C terminated by a null-byte C OUTSTR = STRING that will contain the repeated inputstring C IRPT = INTEGER number of times that the inputstring is to C be repeated C ILEN = INTEGER representing the maximum length of the output C string (optional) C C Author : H.A.M.Fikke C AKZO PHARMA, Oss Holland C dept. SDA C C Version : V1.0 Date : 30-dec-82 C C Module name : REPEAT.FTN C C Package : RSX-LIBRARY C C Compilation/Linking : FOR/F4P/TR:NONE REPEAT C C Updates : name version C C description : C C***************************************************************************** C BYTE INSTR(1),OUTSTR(1) C NRIN=LEN(INSTR) !Length of input string IPOS=1 !Pointer to the next empty place in C ! the output string DO 10 I=1,IRPT IF (IRPT .LE. 0) GOTO 20 IF (LARG(4) .EQ. 0) GOTO 5 IF (ILEN-IPOS .GE. NRIN) 5,20,20 !Space left for a full string? C THEN 5 CALL SCOPY(INSTR,OUTSTR(IPOS)) IPOS=IPOS+NRIN C ENDIF 10 CONTINUE GOTO 30 20 IRES=ILEN-IPOS CALL SCOPY(INSTR,OUTSTR(IPOS),IRES) 30 RETURN END