Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Subject and observer question
Message
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Miscellaneous
Thread ID:
00609821
Message ID:
00610387
Views:
21
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform