Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execscript and CreateObject problem
Message
From
10/06/2008 08:48:37
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01322627
Message ID:
01322790
Views:
13
>>>The ExecScript() dumps the code into temporary PRG, compiles and runs it. It's the same as running external PRG.

Yes, it's the first time of usage that loads this class into memory so the PRG created by EXECSCRIPT() finds it in memory.

SET CLASSLIB TO ...vcx is set, the external fxp created by execscript() also sees this setting. I wonder why this is not sufficient, as SET CLASSLIB does open that vcx and the help on SET CLASSLIB also states:

When CREATEOBJECT( ), ADD OBJECT in DEFINE CLASS, or the AddObject method is issued, Visual FoxPro searches for the class definition defining the object specified in these commands in the following locations and order:

1. The Visual FoxPro base classes.
2. Class definitions in memory in the order they are loaded.
3. Class definitions in the current program.
4. Class definitions in the .vcx class libraries opened with SET CLASSLIB.
5. Class definitions in procedure files opened with SET PROCEDURE.
6 Class definitions in the Visual FoxPro program execution chain.
7. The OLE Registry if SET OLEOBJECT is set to ON.

I wonder if you can load a class into memory without instanciating it. Which would solve the problem. Or if there is a RELEASE CLASSLIB or CLEAR CLASS/CLASSLIB. OR RELEASE ALL or CLEAR ALL running before the CREATEOBJECT, which would explain the problem.

Bye, Olaf.
Previous
Reply
Map
View

Click here to load this message in the networking platform