In the first scan, TheWord3 is set to Indicator. Where does Word3 come from in the second SCAN?
TheWord(s) exist in a table. Word3 is TheWord3 throughout for comparison to TheWord1 and TheWord2 to check for, and avoid duplication. Once the comparison is done and TheWord3 is not the same as 1 or 2, it is saved and TheWord4 begins being compared to 1,2 and 3. Once(or if) 5 distinct indicators are found and saved the code moves on to the next process.
>
>
>>It's almost working, but 4 always equals 3 and I cannot see why.
>>Here's the latest code (attempt):
>>
>> SCAN
>> m.TheWord3 = ALLTRIM(LOWER(indicator))
>> IF m.TheWord3 $ lcTEXT AND ! m.TheWord3 == m.TheWord1 OR ! m.TheWord3 == m.TheWord2
>> REPLACE hits WITH indicator.hits + 1
>> m.sidenote3 = action
>> SELECT MASTER
>> REPLACE indicator3 WITH m.sidenote3
>> ENDIF
>> SELECT indicators
>> ENDSCAN
>> SCAN
>> m.TheWord4 = ALLTRIM(LOWER(indicator))
>> IF m.TheWord4 $ lcTEXT AND ! m.TheWord4 == m.TheWord1 OR ! m.TheWord4 == m.TheWord2 OR ! m.TheWord4 == m.TheWord3
>> REPLACE hits WITH indicator.hits + 1
>> m.sidenote4 = action
>> SELECT MASTER
>> REPLACE indicator4 WITH m.sidenote4
>> ENDIF
>> SELECT indicators
>> ENDSCAN
>>
>>
>>
>>
>>>Are you sure m.TheWord2 is in lcText? If the first condition fails, VFP won't do the second. Perhaps you want an OR instead of AND?
>>>
>>>If the IF logic is correct, create a small dataset with two records, one that you know will pass and one that won't. Step through the code with the debugger. Check values of the variables before going into the IF statement. Also, check the value of SET("EXACT") at that same point.
>>>
>>>
>>>>Thanks Craig and all who are helping. I've been using SET EXACT all along, but this little nipper is a PITA that has all indications of being one of those insignificant "I could have had a V8' moments. (something simple, but overlooked) I noticed that I misspelled 'sidenote' as 'sidenotes' also, but have replaced that portion below. Still no luck with this problem, but it's keeping my elderly brain working. :-)
I ain't skeert of nuttin eh?
Yikes! What was that?