Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Which class is used if 2 classes have same name in class
Message
From
19/04/2016 12:17:10
Lutz Scheffler (Online)
Lutz Scheffler Software Ingenieurbüro
Dresden, Germany
 
 
To
19/04/2016 11:25:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01634985
Message ID:
01634989
Views:
79
What is, in you problm a classlib? A vcx should only have a class once, and it's allways a good idea to have on classenam only once in a pjx.


>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
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform