Bob,
>In implementing subject and observer for the first time, I was having trouble with this code (suggested by the MM devguide) in the observer (agent_list) ProcessUpdate method:
>
>if lcType = "agent"
> do case
> case lcState = 'SAVE'
> thisform.Agent_list.requery()
> otherwise
> return .f.
> endcase
>endif
>
>The code was bombing out with "operator/operand type mismatch" because lcType always evaluated to .f.
I checked this out and just realized there's an error in the Developer's Guide...the code to retrieve the type of the Subject should be:
lcType = loState.cSubjectType
That said, you only need to check the type of the Subject if your Observer has subscribed to more than one subject. My apologies for the confusion!
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com