Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejavascript
// Define external procedure
pjs.defineProc("sqrt", {
  srvpgm: "QSYS/QC2UTIL1",
  parms: [
    { type: 'float', length: 8 }
  ],
  result: { type: 'float', length: 8 }
});


// Use external procedure as a simple function
console.log(sqrt(16));  // output is 4 (the square root of 16)

If the any service program is converted to Node.js in the future, no dependencies will be broken, and you can continue to call the functions in the same exact way.

...