Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which class is used if 2 classes have same name in class
Message
De
25/04/2016 03:00:47
 
 
À
19/04/2016 11:25:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01634985
Message ID:
01635350
Vues:
92
Hi Alejandro:

Having 2 or more classes with the same name on a classlib is one type of classlib corruption, and can be fixed.

If you still have this problem, look at message ID=1634833, on which I explain 2 ways for fixing it.

Regards!


>Does anyone know for sure how does VFP behave if somehow a classlib has two classes with the same name inside?
>
>I have some evidence that it ignores the first class in the classlib and uses the last one, but I need to know if that is reliable behavior. There are other cases VFP picks the last of two definitions with the same name. For example, if there are two procedures with the same name in a prg file the second version gets called, not the first one.
>
>The SET CLASSLIB Command help explanation includes the following:
>
>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.
>
>If the class definition containing the object cannot be located, Visual FoxPro generates an error message.
>
>
>TIA,
>
>Alex
Fernando D. Bozzo
Madrid / Spain
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform