Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Subject and observer question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00609821
Message ID:
00610387
Vues:
22
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform