ON ERROR UNDOlabel1, LEAVE label2, NEXT label2, RETRY label1, RETURN return-valueERROR return-value error-object-expressionNO-APPLY, THROWThe name of the block whose processing you want to undo. If you do not name a block with label1, ON ERROR UNDO undoes the processing of the block started by the statement that contains the ON ERROR phrase.LEAVE label2Indicates that after undoing the processing of a block, the AVM leaves the block labeled label2. If you do not name a block, the AVM leaves the block labeled with label1.NEXT label2Indicates that after undoing the processing of a block, the AVM executes the next iteration of the block you name with the label2 option. If you do not name a block with the NEXT option, the AVM executes the next iteration of the block labeled with label1.RETRY label1Indicates that after undoing the processing of a block, the AVM repeats the same iteration of the block you name with the label1 option.
return-value
ERROR ERROR return-value The AVM also creates an Progress.Lang.AppError object and stores the return-value in the ReturnValue property. ERROR error-object-expression The specified error object is created and populated according to your code. If this is an Progress.Lang.AppError object, the caller can use the RETURN-VALUE function to read the setting of the ReturnValue property. NO-APPLY When used, system error messages generated by statements in the block are suppressed and diverted to a Progress.Lang.SysError object. Any error (SysError, AppError, or user-defined) raised within that block will result in an UNDO of the work in that block’s iteration as long as there is an active transaction. The error object is thrown to the next enclosing block.In r-onerr.p, if you enter a Customer number and the FIND statement is unable to find a Customer with that number, the AVM raises an error. If an error occurs, the ON ERROR phrase tells the AVM to undo anything that was done in the current iteration and start the next iteration. Thus, you see any invalid numbers you enter, and you can continue to the next Customer number you want to enter.
REPEAT ON ERROR UNDO, NEXT:PROMPT-FOR Customer.CustNum.FIND Customer USING Customer.CustNnum.DISPLAY Customer.Name Customer.Address Customer.City Customer.StateCustomer.Country.END.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |