Exiting a PowerBuilder application with ExitCode

There are two ways of getting the exit code from your PowerBuilder application. The first is declaring an external function, as the source below:

Now, just call the function, passing the desired exit code:

The second is to use the LongParm attribute of Message object in the Close event of the application:

The exit code will be stored in the %ERRORLEVEL% variable.

To test it out:

The following two tabs change content below.
Breno RdV
Please allow me to introduce myself...I'm a former psychologist, with almost a decade worth of experience in Human Resources and People Management. Now a developer/software analyst working with PowerBuilder, C#, PowerShell and currently expanding to the world of Python, Xamarin, PHP Angular and (why not?) Unity.



Posted in PowerBuilder and tagged , , , , , .