Sometime when a PowerBuilder application is called by other program or a shell script, programmer want a return code after exiting the PowerBuilder application, just to get the status of the application called.

To give a return code, simply set the Message.LongParm property on the close event of the Application object with the desirable value.

   If ib_endingOK then
Message.LongParm = 1
Else
Message.LongParm = 0
End If