Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Interesting use of Macro subtitution
Message
From
07/02/2000 18:58:32
 
 
To
07/02/2000 17:48:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00327715
Message ID:
00328574
Views:
29
>>Neither of these approaches allows code to be executed purely from within an object's context. With the COMPILE approach, you're creating a standalone PRG. CodeBlock has a special method called SetCallingObject( ), which allows your code to include "THIS." references, which CodeBlock redirects to the object you've passed in.
>
>Just an idea: the object's context can be obtained by passing This as a parameter to the .prg, or ThisForm as well. We could use This.Parent or ThisForm.ActiveObject in the .prg, if the parameters are named This and ThisForm. I'm just wandering if this would add to functionality or to confusion?

Actually I was mistaken--that's the way it does work. (It's been too long since I wrote that part.) It simply has an oCaller property that you can set by passing in an object reference. Then your code block cam refer to THIS.oCaller to "escape" out of CodeBlock's own class confines.

Of course creating a PRIVATE variable before calling CodeBlock can accomplish the same purpose.

-- Randy
Previous
Reply
Map
View

Click here to load this message in the networking platform