Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Which class is used if 2 classes have same name in classlib
Message
De
19/04/2016 11:25:23
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Which class is used if 2 classes have same name in classlib
Divers
Thread ID:
01634985
Message ID:
01634985
Vues:
95
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform