Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_assign with scatter name
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01214016
Message ID:
01214118
Vues:
12
If you need to fire an event, take a look at this_access (which works for access and assign):

THIS_ACCESS Methods
You can create THIS_ACCESS methods to execute code when changing the value for an object member or querying the object member. The THIS_ACCESS method must always return an object reference; otherwise, Visual FoxPro generates an error. Typically, the method returns the object reference, THIS. The THIS_ACCESS method must also include a parameter to accept the name of the object member that is changed or queried.

You would add a method like this:

procedure this_access
lParameters tcMember
....

Alternatively, but I haven't tried this, you could bindevent the properties on the SCATTER object.

If you don't need events, the SCATTER object Ed suggests is the easiest, of course.

Hank

>Hi,
>
>I wonder if I got the _Assign scheme.
>
>I have a business object (bz) that wraps a table. bz has a property oData that I use to access the "current record" of the table via
>
>scatter name this.oDAta
>
>Now I wrote an "assign" method in bz:
>
>procedure oData_Assign
>parameter oData
>this.oData= oData
>...
>wait window oData.Field1
>
>and in Init I have
>
>select <table>
>scatter name this.oData blank
>
>The Assign method gets fired alright, but I get
>
>FIELD1 is not a property
>
>What am I missing?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform