>* Code in controlling object: >lFlag = .T. >BEGIN TRANSACTION >FOR EACH oObject IN colObjects > > * This next block of code is actually contained within each oObject, > * it's not directly within the controlling object: > BEGIN TRANSACTION > SELECT oObject.cCursor > * Make some sort of changes to the cursor > IF TABLEUPDATE(oObject.cCursor) > END TRANSACTION > RETURN .T. > ELSE > ROLLBACK > RETURN .F. > ENDIF > * End of internal block of code > > IF NOT lFlag && Returned T/F from internal block of code > EXIT > ENDIF >ENDFOR > >IF lFlag > END TRANSACTION >ELSE > ROLLBACK >ENDIF >>
* Code in controlling object: BEGIN TRANSACTION TRY FOR EACH oObject IN colObjects SELECT oObject.cCursor * Make some sort of changes to the cursor IF TABLEUPDATE(oObject.cCursor) LOOP ENDIF * save the aError() ERROR "update fail on cursor "+oObject.cCursor ENDFOR END TRANSACTION CATCH to ... * ... FINALLY IF TXNLEVEL()>0 ROLLBACK ENDIF ENDTRY