Accessor events are automatic and syntactically transparent accessor methods. For example, in VisualFoxPro 6, if a method named property_Assign() exists, this method fires automatically when property is modified. If a method named property_Access() is defined, this method fires automatically when property is read. The property_Assign() and property_Access() methods, if they exist, are responsible for completing the transaction and circularities are preempted by the class internals.
Moreover, if a method named THIS_Access() is defined, this method fires for every property read, every property write, and every method call. This_Access() should return an object instance (usually THIS) that will handle the message. Think of this as a pre-hook for all inbound messages destined to an instance.
An example, in VisualFoxPro 6 code:
x.Caption= "this is lowercase"
?x.Caption && echoes "The Caption is: THIS IS LOWERCASE"
?x.Tag && echoes "Instance B"
DEFINE CLASS Foo AS Label
Tag= "Instance A"
FUNCTION Caption_Assign( tcPassed)
*-- Force caption to uppercase
THIS.Caption= UPPER( tcPassed)
RETURN "The Caption is: " + THIS.Caption
oBar= CREATE( "Foo")
oBar.Tag= "Instance B"