>What is the best way to determine if a text string is present anywhere in a field, memory variable or form property. I've looked at the strtran() and I'm not sure if this will do this.
>
>For example, say I have a memory variable called lctext that contains 'Settlement ATM June 30'. What code would I use to determine if the text string 'ATM' is located anywhere in that variable?
>
Presumption: cMemVar contains 'Settlement ATM June 30'
The '$' operator (eg 'ATM' $ cMemvar will return a logical .T.); this is a case sensitive compare operation (eg 'atm' $ cMemvar will return a logical .F.). The ATC() function will return a non-zero value if it occurs, indicating the starting position of the test string within the tested string, and is not case-sensitive (eg ATC('atm',cMemVar) returns a positive integer value).
If you need more robust comparison, look into the LIKE() function which provides some wild card matching ability, or the VBScript.RegExp automation object from the WSH which provides regular expression parsing capability.