Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Classes with the same name
Message
De
28/02/2002 07:06:23
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/02/2002 00:15:07
Information générale
Forum:
Visual FoxPro
Catégorie:
The Mere Mortals Framework
Divers
Thread ID:
00626180
Message ID:
00626276
Vues:
14
>I have an app which is part MM, part not. Many classnames overlap between the MM parts, and the non-MM parts, which means problems when calling createobject('DupeClassName').
>
>When setx runs, it first sets the classlibs of my non-MM parts, which means if I do createobject('BizObjName'), I get the non-MM class to instantiate. I've written a PRG which hardcodes a solution (through RELEASE CLASSLIB ALIAS X IN APP), but it's obivously not very flexible.
>
>Is there another way in MM to handle duplicate class names? And does this mean that duplicate class names are forbidden in MM?
>
>Thanks
>
>David

David,
VCXes are also tables which you can alias.

set classlib to ('classes1\myClassLib') alias my1 additive
set classlib to ('classes2\myClassLib') alias my2 additive
set classlib to ('classes3\myClassLib') alias my3 additive

o1 = createobject('my1.myclass')
o2 = createobject('my2.myclass')
o3 = createobject('my3.myclass')

In VFP6 and up NewObject() is an easier way.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform