Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Find element in an array that is closest but greater than or equal to the argument.Lookup allows you to find an element which is great than the argument you pass to the lookup function. This API will return the index of the value if it has found a match, otherwise it will return 0.

Parameters
  1. Search argument
  2. Array
  3. Start index (OR resulting indicators object)
  4. Resulting indicators (can be null)
Return Value

Function will return 0 if no matching element has been found, otherwise it will return the element index.

Example
Code Block
languagejavascript
  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(), LOOKUP