Xbasic

TEXTSEARCH Function

Syntax

Result_Flag as L = TEXTSEARCH(C string,C search_pattern)

Arguments

string

The character string to find.

search_pattern

The character string to examine for occurrences of string.

Description

Search a string for a pattern - uses AND, OR between phrases in pattern, and NOT in front of excludes.

Discussion

Returns .T. (TRUE) if string is found in search_pattern. String string can contain the reserved Boolean words "and" and "or". After a query is run using the TEXTSEARCH() function, Alpha Anywhere highlights the words that were found when the data is viewed using a form. The search is case insensitive and may contain wildcard characters (* and ?).

Example

textsearch("now is the time for all good men", "time AND good") -> .T.
textsearch("now is the time for all good men", "time AND bad") -> .F.
textsearch("now is the time for all good men", "im") -> .F.
textsearch("now is the time for all good men", "*im*") -> .T.

See Also