Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The object itself
Message
From
28/05/2007 13:03:31
 
 
To
28/05/2007 10:30:33
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Environment versions
Visual FoxPro:
VFP 6 SP5
Miscellaneous
Thread ID:
01228871
Message ID:
01228882
Views:
14
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform