The following code in the IsChanged method of cBizObj would seem to me to have a problem with table buffered cursors: <B> IF CURSORGETPROP("BUFFERING") = DB_BUFOFF * If there is no buffering, there can be no pending changes. RETURN .F. ENDIF
*** EGL: 10/26/1999 - Make sure that the current record isn't new and empty first. *** Pass .T. to limit the check to just this bizobj. IF This.IsNewAndEmpty(.T.) This.Cancel() ENDIF
IF CURSORGETPROP("BUFFERING") = DB_BUFOPTTABLE * See IF there is a modified record anywhere in the cursor. llIsChanged = (GETNEXTMODIFIED(0) # 0) ELSE ... </B> If the BizObj is for a table buffered child that has had changes made to records, but the record pointer has been moved about before saving, then the <B>IsNewAndEmpty</B> call returns True because the Memento sees no changes for the currently selected record. <B>IsNewAndEmpty</B> should not called if table buffering is on. Moving this call to the <B>else</B> clause would fix that.
We would still have two calls to the memento's <B>CompareState</B> method one right after the other: first in the <B>IsNewAndEmpty</B> method and then another immediately after it back in the <B>IsChanged</B> method. That offends my sense of efficiency, but I've got to get back to work, so I'll leave it up to others to decide if that is worth worrying about. Jim Hansen Canyon Country Consulting ©2001 James H. Hansen |