searchanycase(
TEXT
,
PHRASE
)

The searchanycase( function searches through an item of text looking for a character, word or phrase. If it finds a match (upper/lower case may be different) with the character, word or phrase it returns its position within the text item. If it does not find the character, word or phrase it returns zero.


Parameters

This function has two parameters:

text – is the item of text that you want to search through.

phrase – is the character, word or phrase that you want to search for. This must be the exact character, word, or phrase, excluding upper or lower case. The searchanycase( function will match Dr with DR or dr. Use the search( function if you want an exact match.


Description

This simple procedure uses the searchanycase( function to attempt to locate and display a fax number in the Notes field. This procedure assumes that the fax number will look some- thing like this: fax (999) 555–0123.

local X
X=searchanycase(Notes,"fax (")
if X<>0
    message "Fax Number: "+Notes[X+4;14]
endif

The example starts by searching for the phrase fax (. If it finds this phrase, it displays the 14 characters starting with the ( symbol. (Because this function ignores upper vs. lower case, it will find a match even if the word fax is all or partially in upper case, for example FAX or Fax.)


See Also


History

VersionStatusNotes
10.0NewThis function is new in this release.