Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Class defined in execscript() vanishes
Message
From
28/09/2007 14:24:09
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
28/09/2007 13:46:09
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01257351
Message ID:
01257507
Views:
21
>Hi Dragan!
>
>Have you tried to pass a variable by reference, not by value to the script and place the object in this variable?
>Something like this:
>
>
>Local lcScript, loMyObject
>lcScript = "LParameters loMyObject" + Chr(13) + ;
>           "loMyObject = CreateObject('MyClass')" + Chr(13) + ;
>           "Return" + Chr(13)
>ExecScript(lcScript,@loMyObject)
>Return
>
The parameter was an object, and objects are always passed by reference. The (pseudo) code went like this:
lparameters toCaller
o=createobject("myclass")
toCaller.oProperty=o

define class myclass as myOtherClass of over\there\myOtherClasses.prg

procedure userhook()

enddefine
Anyway, I've already fixed it to copy the script out into a temp prg (on sys(2025)), and the caller is trying to delete it after this.oProperty=null in .unload(), but VFP doesn't close the file that early, so that errors out. I've unearthed some of my code from 2001 which purges the temp files older than three days - I can live with that, lot of software _never_ cleans up :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform