pjs.lookupGT()

pjs.lookupGT()

Description

This API allows you to find an array element which is greater than the argument you pass to it.

An optional resulting indicators object can specify if any elements in the flags array should be set. The resulting indicators object can have this property:

  • high (Number) - Identifies the flag number to set if the nearest higher entry is found.

Parameters

  1. Search argument - Value to search for.

  2. Array - The array to search.

  3. Start index - Position to start searching from (OR the resulting indicators object).

  4. Resulting indicators (optional) - Flag numbers to set, as described above.

Return Value

Returns 0 if no matching element is found; otherwise, the element index is returned.

Example

pjs.define("Word1", { type: 'char', length: 15 }); pjs.define("arr1", { type: 'char', length: 15, dim: 5, orderby: 'DESCEND' }); arr1[1] = 'Patrick'; arr1[2] = 'Owenals'; arr1[3] = 'Nancy'; arr1[4] = 'Manan'; arr1[5] = 'Lincoln'; Word1 = 'Manan'; pjs.lookupGT(Word1, arr1, { high: 72 });

RPG Equivalent

%LOOKUPGT()


Related Pages