Exec.OnError
Description
- Sets where PowerPro error messages go and whether HookErrors list is run.
Syntax
Parameters
- keywords
- (string) Single string comprising any combination of the keywords, separated with spaces.
-
Possible Values
- none
- Do not display any error messages.
- file
- Write errors messages to file ErrorLog.txt only.
- must be in same folder as .pcf
- each error creates a line of space-separated info
- yyyymmdd
- hhmmss
- scriptname (or *)
- linenumber (or 0)
- messagetext
- newlines replaced with blanks
- display
- Display messages on screen only.
- both
- Write error to file and display on screen.
- hook
- Run command list HookErrors whenever an error occurs.
- unhook
- Do not run command list HookErrors.
- clear
- Set _LastError_ global variable to "".
- Alternative form of: _LastError_=""
Examples
- Exec.OnError("none hook")
- Stops display of error messages & turns on the command list HookErrors to be run for each PowerPro error.
- Exec.OnError("file unhook clear")
- Sets PowerPro to write errors to the ErrorLog.txt file, turns off the HookErrors command list, & clears the global variable _LastError_.
- Exec.OnError("both")
- Tells PowerPro to write errors to file and display them on screen.
Notes
- The global variable _LastError_ is set to the error message whenever any error occurs.
- If an error occurs while the HookErrors script is running, the script is not called again.