***********************WORKING HERE************************* IF LEN(ALLTRIM(lcTEXT)) > 3 SELECT KEYWORDS SCAN TempKey = KEYWORDS.keyword TempKey = LOWER(TempKey) TempCtrlWord = KEYWORDS.ctrlword IF Tempkey $ lcTEXT SELECT results APPEND BLANK REPLACE results.WORD WITH TempKey REPLACE results.ctrlword WITH TempCtrlWord WordStart = AT(lcTEXT, TempKey,1) PreWord = SUBSTR(lcTEXT,(WordStart-31),30) REPLACE Results.pre WITH PreWord WordEnd = RAT(TempKey,lcTEXT,1) PostWord = SUBSTR(lcTEXT,(WordEnd+1),30) REPLACE Results.Post WITH PostWord SELECT KEYWORDS Thisform.refresh &&& TEMP DEBUG ENDIF ENDSCAN * RAT(cSearchExpression, cExpressionSearched [, nOccurrence]) * RAT Returns the numeric position of the last (rightmost) occurrence * of a character string within another character string. * AT(cSearchExpression, cExpressionSearched [, nOccurrence]) * Returns the beginning numeric position of the first occurrence * of a character expression or memo field within another character * expression or memo field, counting from the leftmost character. * SUBSTR(cExpression, nStartPosition [, nCharactersReturned]) * Returns a character string from the given character expression * or memo field, starting at a specified position in the character * expression or memo field and continuing for a specified number * of characters. ********************END WORKING HERE*************************