Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_assign with scatter name
Message
 
À
10/04/2007 13:59:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
01214016
Message ID:
01214120
Vues:
9
For some unidentified reason, the _assign method needs
this.oData=oData
if (type("oData")<>"O") or (isnull(oData))
    return
endif
>>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?
>
>You could change your code to following:
>Init event
>
>select yourtable
>scatter name oTemp blank
>this.oData=oTemp
>
>Assign method in bz:
>
>procedure oData_Assign
>parameter oData
>this.oData= oData
>if type(this.odata)<>'O'
>  return
>endif
>...
>wait window oData.Field1
>

If things have the tendency to go your way, do not worry. It won't last. Jules Renard.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform