C This software FINDSUBS.FOR is part of the Visual Fortran kit.
C
C This software is provided as an example that demonstrates a particular
C feature/function of the licensed product. The software is not intended to
C provide a complete solution to any application problem but rather is provided
C as a teaching mechanism.
C
C Users may incorporate any part of this sample into their own source after 
C making appropriate changes to make it suitable for the intended application.
C       
C
	SUBROUTINE FIND_SUBSTRINGS(SUB, S)
	!DEC$ ATTRIBUTES DLLEXPORT :: FIND_SUBSTRINGS
	CHARACTER*(*) SUB,S
	CHARACTER*132 MARKS

	I = 1
	K = 1
	MARKS = ' '

10      J = INDEX(S(I:), SUB)
	IF (J .NE. 0) THEN
	    I = I + (J-1)
	    MARKS(I:I) = '#'
	    K = I
	    I = I+1
	    IF (I .LE. LEN(S)) GO TO 10
	    ENDIF

	WRITE(6,100) S, MARKS(:K)
100     FORMAT( 2(/1X, A) )
	END
