printerFile.status()

API Overview

The printerFile.status() API returns the file status code for the last operation on a printer file.

RPG Equivalent

%STATUS(FILENAME)

Contents


Return Value

The status code for the most recent operation on the file.

Examples

Manually open printer file
pjs.definePrinter("printer", { overflowIndicator: "overflow" });
try {
 
  printer.write();
 
}
catch (error) {
 
  console.log(`An error occurred. Status code ${printer.status()}`);
 
}