INTEGER FUNCTION IDX (SRC, STR) C C Find position of one string in another C C SRC = source string C STR = target string C C Value of function is zero if not found, C or position of first character of STR in SRC if found C BYTE SRC(1), STR(1) C C Look for STR in SRC until end of SRC C J = 0 10 J = J + 1 I = 0 IF (SRC(J) .EQ. 0) GOTO 30 C C If end of STR then success C If not match look at next position in SRC C 20 IF (STR(I+1) .EQ. 0) GOTO 40 IF (SRC(J+I) .NE. STR(I+1)) GOTO 10 I = I + 1 GOTO 20 C C Return failure C 30 IDX = 0 RETURN C C Return success, position of string C 40 IDX = J RETURN C END