2.5.4.38 Find

The Find function performs a search for the first instance of a text string within another text string.

ABNF:

 Find = val val [val [val]] sp ("2" / "3" / "4") ";FIND():129"

Required Arguments:

Name: FindText

Type: vString

An argument that specifies the string to be found.

Name: WithinText

Type: vString

An argument that specifies the string to search within.

Optional Arguments:

Name: StartNum

Type: vUnsignedInt

An argument that specifies the one-based position in the WithinText string at which this function starts a search. The default value is one.

Name: IgnoreCase

Type: vBoolean

An argument that specifies whether the search is case insensitive. A value of TRUE specifies that case is ignored. The default value is FALSE.

Return Value:

Type: PtgUnsWord, PtgErr

This function returns a PtgUnsWord containing the one-based position in WithinText at which FindText is found. If FindText is empty and StartNum is less than or equal to the number of characters in WithinText, the function returns a PtgUnsWord containing the value of StartNum. If FindText is empty and StartNum is greater than the number of characters in WithinText, the function returns a PtgUnsword containing the value of the number of characters in WithinText plus one. If FindText is not found, or, if StartNum is equal to zero or greater than the number of characters in WithinText, the function returns a PtgErr with an error code of #VALUE!. The search is performed according to .NET globalization rules based on the LCID in the DocumentLanguage field of the Properties GlobalElement in the App XML Part of the document. For more information about .NET globalization rules, see [MSDN-ENCLOC].