pjs.lr()
This API, when used after the call of a Profound.js module, returns a boolean value based on the flags[“LR“] value of the called Profound.js module.
There is no support for returning the LR indicator value of a called RPG program.
Return Value
A boolean.
true - The called Profound.js module ended with flags[“LR“] set to true.
false - The called Profound.js module ended with flags[“LR“] set to false, or does not contain any flags variable (indicators).
Example #1
Let’s take a very simple scenario of a Profound.js module A (moduleA) calling a Profound.js module B (moduleB).
In moduleA, the constant moduleB_LR_flag is set to true if moduleB ends with flags[“LR“] set to true.
Module A:
function moduleA() {
moduleB();
const moduleB_LR_flag = pjs.lr();
if (moduleB_LR_flag ) {
console.log("Module B ended with flags["LR"] set to true");
} else {
console.log("Module B ended with flags["LR"] set to false");
}
}
exports.default = moduleA;Module B:
function moduleB() {
console.log("Module B was called");
// Add custom code here...
flags["LR"] = true;
}
exports.default = moduleB;
Example #2
This fixed-form RPG line of code shows a CALL operation.
It has indicator 93 on positions 75-76 (LR indicator).
C CALL 'TEST' 93In Profound.js, it would be written as following:
test();
flags[93] = pjs.lr();
Requires PJS version 7.20.0 or later.