Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which type of class to use?
Message
From
30/12/2004 12:05:52
 
 
To
30/12/2004 08:54:09
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00973101
Message ID:
00973320
Views:
15
Tracy,

>If I create the class manually using the ide by: 'create class' with nothing else in the command line in the command window, when the new class window pops up 'empty' is not available in the dropdown box...

The problem is that the Empty class cannot be subclassed, so you cannot DEFINE CLASS whatever AS Empty. You can only instantiate it as-is, perhaps then using the ADDPROPERTY() stand-alone function to add to it or scattering a record to it (using the ADDITIVE clause to leave undisturbed any other props you added).
oemp=CREATEOBJECT("empty")
ADDPROPERTY(oemp, "ctest", "Test")
USE sometable
SCATTER NAME oemp ADDITIVE
* you now have the added "ctest" property, plus the fields from
* the scatter name
oemp.
As for the use you mentioned, I agree with others about the Session class being a real workhorse when dealing with data, since it automatically puts a box around your data environment and lets you do ANYTHING with data (opening tables, close database, whatever) inside the class without disturbing anything outside the class.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Reply
Map
View

Click here to load this message in the networking platform