Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The object itself
Message
De
28/05/2007 13:16:40
 
 
À
28/05/2007 12:29:41
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 6 SP5
Divers
Thread ID:
01228871
Message ID:
01228888
Vues:
15
This message has been marked as a message which has helped to the initial question of the thread.
>>Code similar to the following gives me a compiler error:
>>
>>
>>with SomeObject
>>  SomeFunction(., par2, par3)
>>endwith
>>
>>
>>I want to pass the object itself - SomeObject - as a parameter. The object reference itself is much more complicated, so I don't want to repeat it in the function call.
>>
>>I guess as a workaround, I'll have to use an object variable, but I thought there MIGHT be some other way to refer to the object itself, within a WITH.
>
>Not that I know of, your workaround is as good as it gets. I missed that several times as well.
>
>If anyone knows how to defeat this, I'm interested too.

I don't know of a way innate to VFP, but in the init, I like to add a property called self to my objects.

This.AddProperty('Self', This)

Then, of course, it's easy to send .self as a parameter withing a with...endwith.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform