>I am tring to find a way to check for a string within a string but what I have came uo with is strill not working every time.
>
>I am using the AT() function but this fails if my:
>
>search expression is revJ
>and searched expression is 855956-401 revJ2
>
>J and J2 are two different revision levels.
>
>Sometimes searched expression can be more complex like:
>855965-401 revJ2, 855965-403 revJ2, 855965-405 revJ2
>
>Any ideas?
Can you check the next character against a list of valid delimiters? Something like
llFound = .F.
nPos = AT(lcRevision,lcExpression)
IF nPos+LEN(lcRevision)-1 = LEN(lcExpression)
llFound = .T.
ELSE
llFound = INLIST(SUBSTR(lcExpression,nPos+LEN(lcRevision),1),","," ",";",'.')
ENDIF
ENDIF
I don't have a solution for more complex search expressions that have two revision built in. What should happen, for example, to
855965-401 revJ, 855965-403 revJ1, 855965-405 revJ2
or
855965-401 revJ2, 855965-403 revJ1, 855965-405 revJ
but if the code works for the simple case you might be able to play around with the
nOccurence parameter of AT().