2.5.4.61 Lookup

The Lookup function calculates the index location of a substring within a delimited text string.

ABNF:

 Lookup = val val [val] sp ("2" / "3") ";LOOKUP():129"

Required Arguments:

Name: Key

Type: vString

An argument that specifies the substring to find.

Name: List

Type: vString

An argument that specifies a string consisting of a list of delimited substrings. If the list begins and/or ends with Delimiter, an empty string is assumed to exist at the beginning and/or end of List, respectively. Consecutive delimiters indicate an empty string between them.

Optional Arguments:

Name: Delimiter

Type: vString

An argument that specifies the delimiter that separates substrings inside List. If this argument is an empty string, the default value ";" is used.

Return Value:

Type: PtgNum

This function returns a PtgNum containing the zero-based index location of the substring in List that matches Key. The leading and trailing spaces of substrings in List are ignored for the comparison. If Key contains Delimiter or if Key is not found in List, the function returns a PtgNum containing a value of -1. The comparison 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].