Errorhandling

As already discussed in the section Sending requests there is a distinction between errors occurring in the request handling by WindowsEnabler and errors occurring during the program execution on the PC. Errors occurring during program execution cannot be detected by WindowsEnabler, other than by the return values that are send by the program.

When an error, for example a time-out, occurs during the request handling WindowsEnabler/400 sends an SWP2099 or SRM2099 escape message. You can determine the exact cause of the errors by looking at the diagnostic messages that are send before the escape messages.

For requests other than a program request, you will always receive an SWP0101 or SRM0101 completion message if no errors occurred in the handling of the request.

For program requests you only receive this message if you wait for completion through the WAIT(*YES) parameter. If you do not wait for completion, you receive a SWP0100 once the PC program is started.

If you receive an SWP0101 or SRM0101 completion message, you can determine the PC return value. This return value is located in a message parameter of the completion message and it is written to the dataarea WINRES in library QTEMP.