Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which type of class to use?
Message
De
30/12/2004 12:05:52
 
 
À
30/12/2004 08:54:09
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00973101
Message ID:
00973320
Vues:
16
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform