Returns an optional exit code set by the application, when the AVM process ends.
Data type: INTEGER
Access: Readable/Writeable
Applies to: SESSION system handle
The attribute allows the application to optionally set a program exit code. This provides meaningful feedback to the shell script and allows the creation of automation scripting around the termination of the ABL application.
This attribute is set to the Unknown value (?) if not set by the application.
For example:
SESSION:EXIT-CODE=123. SESSION:EXIT-CODE=myIntVar. |
Windows allows positive integer values (0-32,767). UNIX restricts this to the range of 0 through 255 (inclusive). If you attempt to set an improper value for your platform, a runtime error is raised.
If an AVM process running as an AppServer or WebSpeed agent sets an EXIT-CODE value, a runtime error is raised.
The exit code specified by SESSION:EXIT-CODE can be printed from a bash shell as shown in the following example:
$PROEXE -p MyTest.p -b echo $? |
In Windows, the exit code can be printed from the command line as shown below:
start /wait $PROEXE -p MyTest.p -b echo %errorlevel% |
In Windows PowerShell the pseudo-environment variable is called by $LastExitCode instead of %errorlevel%.