Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling problems deep in BOs
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00837088
Message ID:
00837407
Vues:
25
You can handle this a few ways. One way I've done this is to include an _assign method on a cStatusMsg property (which could just as easily be a method, if you prefer). I include another property named oStatus, that is normally set to .NULL. Inside the assign method, I check to see if this property evaluates to an object. If it does, I check to make sure it has a method named "SetStatus()", or something along those lines. If it does, I pass the method my error message. The idea is that you instanciate the object and set the oStatus method to a form reference that implements SetStatus(). Now the business object will automatically display some UI (and the two objects aren't tightly coupled). In VFP 8, this kind of thing can be done using BINDEVENT w/o having to include any checks for oStatus (eg. you bind your form method to the "event" method on the business object).
>
>While I almost always use this to pass the message in one direction, you can easily create this kind of hook method to pass messages back to the business object. Just call the form method (if it exists) and grab it's return value. Then act on it.
>
>Hope that helps.


This is interesting. I don't know anything about BINDEVENT, so it looks like I have some reading to do.

Thanks,

Michelle
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform