Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

This API gets the current position of a multiple-occurrence data structure.

Parameter
  1. Data structure
Return value

This API returns the current occurrence in the data-structure.

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()

  • No labels