Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does a DEFINE CLASS... class exist?
Message
De
21/05/2003 15:12:27
 
 
À
21/05/2003 12:41:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00787527
Message ID:
00791271
Vues:
27
>Running a procedure file that contains a class definition does not actually define a class in memory...IOW, if there is no procedural code at the top of the file, nothing runs.
>
>Any thoughts, Fred?

Well, you're both kind of right on this one. There is no instanciation of the class as an object, but the class definition can be located through VFP's standard function/procedure hierarchy (IE SET CLASSLIB, SET PROCEDURE, program chain) so it is somewhere in memory. I have no idea how you can access that chain programmatically, though.



>
>>Yes, many examples. All to do with the fact that we write class definitions in code on the fly during run time to a temporary procedure file, then execute the procedure file to define the class, then add the class to the parent object.
>>
>>In most cases, if there is anything wrong with the code that defines the class, an error results. But in some cases an error does not result even though a problem with the define code has prevented the class from being defined, and the AddObject() code errors out when it attempts to create an object from a class that has not been defined.
>>
>>It is for this reason that I need to know if the class was actually defined and exists in memory BEFORE I attempt to AddObject() from the class. I have not found a native VFP process that will tell me whether or not the class has been defined and exists in memory.
>>
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform