LOCAL lbRetVal lbRetVal = .t. IF NOT TableUpdate(1, .t., this.Alias) AERROR(laError) MessageBox("Can not update "+this.Alias+", because:"+CHR(13)+; laError[1,2]) lbRetVal = .f. ENDIF RETURN lbRetValand than instead of calling TABLEUPDATE call:
IF NOT CAInstance.UpdateTable() *** Logic if you can't update the table ELSE *** Logic if you can update the table ENDIFOf course you can construct that method as you wish, to pass first two parameters that TABLEUPDATE() receives, but the last one ALWAYS should be [this.Alias].
LPARAMETERS lbUpdateAll, lbOverwrite, lbNOTShowMessage IF PCOUNT() < 1 lbUpdateAll = 1 ENDIF IF PCOUNT() < 3 lbOverwrite = .t. ENDIF *** lbNOTShowMessage is used as default - .f. LOCAL lbRetVal, lcError lbRetVal = .t. IF NOT TableUpdate(lbUpdateAll, lbOverwrite, this.Alias) AERROR(laError) lcError = "Can not update "+this.Alias+", because:" + CHR(13) + laError[1,2] IF NOT m.lbNOTShowMessage MessageBox(lcError) ELSE **** Log the error ENDIF lbRetVal = .f. ENDIF RETURN lbRetVal