...
- Navigate to the workspace "pjstips".
- Click New/Javascript File.
- Enter the code below. Click Save As, and save as pjstips_07_1.js. Note that this is very simple code, as an example. You can do anything you want here (e.g. use various PJS API's such as pjs.define(), call pjs.query() to get data, use pjs.call() to call an IBMi program, etc).
Code Block | ||||
---|---|---|---|---|
| ||||
function app(firstName, lastName) { pjs.define("firstName", { type: 'char', length: 30, refParm: firstName }); pjs.define("lastName" , { type: 'char', length: 30, refParm: lastName }); let fullName = `${firstName.trim()} ${lastName.trim()}`; console.log(`fullName = ${fullName}`); } exports.run = app; exports.parms = [ { type: 'char', length: 30 }, // firstName { type: 'char', length: 30 } // lastName ]; |
...