pjs.assign()



Assigns a value to a field while handling overflow.

Parameters
  1. Result field

  2. Value to assign

  3. Half adjust (Boolean)

Example

pjs.define("Num", { type: 'packed decimal', length: 2, decimals: 0 }); Num = 98; pjs.assign(Num, Num + 1); // Num becomes 99 pjs.assign(Num, Num + 1); // Num becomes 0 because of overflow

RPG Equivalent  

ADD, DIV, MULT, SUB