LISTLOOKUP Function

── LISTLOOKUP ── ( ──<arithmetic expression>── , ──<array row>── , ────►
►─<arithmetic expression>── ) ─────────────────────────────────────────┤

The LISTLOOKUP function causes a linked list of words to be searched and returns, as an integer value, an index into the list as follows:

  1. The array row is indexed by the value of the second arithmetic expression and the word is extracted. Each word contains a value (in field [47:28]) and a link (in field [19:20]) to the next word of the linked list.

  2. If the value in the extracted word is greater than or equal to the value of the first arithmetic expression, the operation stops, and the index of the word whose link points to the extracted word is returned by the function.

  3. If the value in the extracted word is less than the value of the first arithmetic expression, the link of the extracted word is used as an index into the array row, a new word is extracted, and the process is repeated.

A word with a link of 0 terminates the search. The value of a word is tested only if the link field is nonzero. If the linked list is exhausted, that is, (if a word with a link of 0 is encountered), a value of -1 is returned by the LISTLOOKUP function.