Scan provides the ability to look for a value in a string. Puts each result into an element in order they are found.
Parameters
- Array to put results into
- Value to look for
- Index to start from
- Length to search for
Example
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];