API reference
The API reference for WRT.
w96.WRT
w96.WRTDescription: Runs a script under WRT and returns the result of the evaluation. The result is a Promise, since WRT scripts are ran asynchronously by default.
Examples:
const scriptResult = await w96.WRT.run("return await FS.readstr('c:/system/credits.txt')");
// Returns the contents of c:/system/credits.txt// A simple module include demonstration
// Includes can use relative paths, unlike the standard Windows 96 FS functions.
/* ======= code to eval with WRT ======= */
const code = `const myModule = await include("c:/test.js");
console.log(myModule.something());`;
await w96.WRT.run(code);
/* ======= code for c:/test.js ======= */
module.exports = {
something: ()=>"Hello, world!"
}Description: Runs a script file under WRT and returns the result of the evaluation. Like WRT.run, the result is a Promise since its ran asynchronously.
Examples:
Last updated
Was this helpful?