* * Save the old setting * LPARAMETERS tuP1, tuP2, tuP3, tuP4, tuP5 THIS.cCommand = ALLTRIM(tuP1) THIS.cOldSetting = TRIM(PADR(SET(THIS.cCommand), 50))DoIt:
* * Set the new value * LPARAMETERS tuP1, tuP2, tuP3, tuP4, tuP5 LOCAL lcCommand, lcValue IF TYPE('tuP2') = 'C' * * A new setting was requested so set it * lcValue = ALLTRIM(tuP2) lcCommand = 'SET ' + THIS.cCommand + ' ' + lcValue &lcCommand ENDIFUnDoIt:
* * Reset the old value * LOCAL lcCommand * * A new setting was requested so set it * lcCommand = 'SET ' + THIS.cCommand + ' ' + THIS.cOldSetting &lcCommandThis class in turn is based on DoUndo class with the following code in Init method:
* * Change a settings and reset it when the object is destroyed * LPARAMETERS tuP1, tuP2, tuP3, tuP4, tuP5 * * Save the old setting * THIS.SaveIt(tuP1, tuP2, tuP3, tuP4, tuP5) * * Change to the new setting * THIS.DoIt(tuP1, tuP2, tuP3, tuP4, tuP5)Now, is it possible for the normal developer to understand all of this without any program documentation? :)
>>* >>* Save the old setting >>* >>LPARAMETERS tuP1, tuP2, tuP3, tuP4, tuP5 >>LOCAL loPoint >> >>loPoint = CreateObject('Set_Point', '.') >> >>DODEFAULT(tuP1, tuP2, tuP3, tuP4, tuP5) >> >>THIS.cSet1 = TRIM(PADR(SET(THIS.cCommand, 1), 50))>>