lnFields = afields(laFields) for lnI = 1 to lnFields lcField = laFields[lnI] luOldVal = oldval(lcField) luCurVal = curval(lcField) luValue = evaluate(lcField) llOtherUser = luOldVal <> luCurVal llThisUser = luValue <> luOldVal llSameChange = luValue == luCurVal do case * The other user edited this field but this user didn't, so grab the new * value. case llOtherUser and not llThisUser replace (lcField) with luCurVal * The other user didn't edit this field, or they both made the same change, * so we don't need to do anything. case not llOtherUser or llSameChange * Uh-oh, both users changed this field, but to different values, so we have a * "real" conflict. In the case of the SummaryCount field, we'll handle it by * applying changes both users made. For any other field, flag that we have * a conflict. case lcField = 'SUMMARYCOUNT' lnOtherUserChange = luCurVal - luOldVal lnThisUserChange = luValue - luOldVal replace (lcField) with luOldVal + luOtherUserChange + ; luThisUserChange otherwise llConflict = .T. endcase next * If we don't have a "real" conflict, force all the changes. if not llConflict llSuccess = tableupdate(2, .T.) else *** handle a "real" conflict in some way eg. ask the user what to do endifBy using the REPLACE command to force this user's record to contain the values we want, and then forcing the update (the .T. parameter in TABLEUPDATE()), changes both users made to the SummaryCount field are handled.