>Since the advent of VFP, most people control the state of their forms through a custom form property. For example, we may have a form property called EditState with valid values of 0(idle),1(editing),2(appending).
>
>So, typically, in the Click() method of an Edit button on a form, you may have similar to the following (but probably more complicated):
>
>THISFORM.EditState=1
>THISFORM.SetAll("Enabled",.T.)
>THISFORM.Refresh()
>
>With VFP6, there is a much simpler way to do this. With the new ASSIGN method, you can add an _Assign to any property, custom or native. So...we would create an EditState_Assign method for our form, with the following code (THIS not THISFORM as its a form method):
>
>LPARAMETERS tNewVal
>THIS.EditState=tNewVal
>THIS.SetAll("Enabled",.T.)
>THIS.Refresh()
>
>
>The Edit button Click() method is reduced to nothing but THISFORM.EditState=1. The EditState_Assign method automatically does the rest, encapsulating the behavior of a state change at the level it belongs.
>
>TTFN!
OOO....excellent! Looks like it's time to do a bit of rework on my foundation.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer