Syntax Example:
var i SmallInt endVar try i = 0 i = 1/i onFail msgInfo("", "You cannot divide by zero.") endTry Here is an example from a pushButton event: method pushButton(var eventInfo Event) var i SmallInt endVar errorTrapOnWarnings(True) try i = 0 i = 1/i msgInfo("", "This line of code never executes.") onFail msgInfo("", "You cannot divide by zero.") endTry msgInfo("", "This line always executes.") endMethod
The following example shows you the last ObjectPAL error: errorTrapOnWarnings(yes) try ;Your code here onFail msgStop( errorCode(), errorMessage() ) ;You could also use errorShow() endTry
More Info
|