Stores an ECMAScript scalar variable, string, or numeric literal in a MUMPS global node.
jsm.set(global, subscripts, data, callback);
Arguments
global
The name of the MUMPS global into which the scalar value will be stored.
subscripts
An ECMAScript array indicating the subscript level within global
into which the variable will be stored.
data
The ECMAScript variable or string/numeric literal to be stored.
callback
The callback function to be executed when the data has been stored, or when an error occurs. Per Node.js conventions, this callback function takes two arguments, err and data.
Example
After running the following example, ^KBBMTEST(1)
will contain the value foo
.
const jsmumps = require('jsmumps');
const jsm = new jsmumps.JSMumps();
jsm.set('KBBMTEST', [1], 'foo', (err, data) => {
if(!err) {
console.log('Data saved successfully!');
}
});