Content Freeze
As of July 25th, 2023, there is a content freeze on this page.
This API gets the current position of a multiple-occurrence data structure.
Parameter
- Data structure
Return value
Numeric value representing the current occurrence position
Example
pjs.define("ds", { type: 'data structure', qualified: true, occurs: 2, elements: { "sub1": { type: 'char', length: 1 }, "sub2": { type: 'char', length: 1 } }}); pjs.define("test1", { type: 'integer', length: 3, decimals: 0 }); pjs.define("test2", { type: 'integer', length: 3, decimals: 0 }); pjs.define("test3", { type: 'integer', length: 3, decimals: 0 }); test1 = pjs.getOccur(ds); pjs.setOccur(ds, pjs.getOccur(ds) + 1); test2 = pjs.getOccur(ds); pjs.setOccur(ds, pjs.getOccur(ds) - 1); test3 = pjs.getOccur(ds);
RPG Equivalent
OCCUR, %OCCUR()