Versions Compared

Key

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

Scan provides the ability to look for a value in a string. Puts each result into an element in order they are found.

Parameters
  1. Array to put results into
  2. Value to look for
  3. Index to start from
  4. Length to search for
Example
Code Block
languagejavascript
  pjs.define("Arr1", { type: 'packed decimal', length: 1, decimals: 0, dim: 3 });
  pjs.define("FIELD1", { type: 'char', length: 7 });
  pjs.define("FIELD2", { type: 'char', length: 1 });

  pjs.move(FIELD1, 'YARYRYY');
  pjs.move(FIELD2, 'Y');
 
  FIELD1.scanToArray(Arr1, FIELD2, 3);
 
  result = Arr1[1] + Arr1[2] + Arr1[3];