Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The object itself
Message
De
28/05/2007 13:03:31
 
 
À
28/05/2007 10:30:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
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:
01228882
Vues:
17
>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.

The VFP's OOP is lacked here.

A possible workaround is:
add to the class a ThisObject property with
procedure ThisObject_Access
 RETURN m.This
and then
with SomeObject
  SomeFunction(.ThisObject, par2, par3)
endwith
A best VFP design is to support a WITHOBJ Reference
with SomeObject
  SomeFunction(WITHOBJ, par2, par3)
endwith
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform