Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The creature that won't die
Message
De
23/03/2010 18:22:22
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
23/03/2010 10:21:35
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
VFP Compiler for .NET
Divers
Thread ID:
01456123
Message ID:
01456808
Vues:
80
>(just very simplistic, not tested)
>
>
FUNCTION AddObjectToContainer(cClassKey, oParent, cName)
>LOCAL oObject
>
>oObject = NULL
>
>IF !USED("MyFactoryClasses") 
>   USE MyFactoryClasses IN 0 ORDER ClassKey
>ENDIF
>
>IF SEEK(cClassKey, "MyFactoryClasses")
>    oParent.AddObject(cName,  MyFactoryClasses.ActualClass)
>***    oObject = oParent.&cName
   oObject=getpem(oParent, cName)
>ENDIF
>RETURN oObject
And you don't even need the macro. See my intervention above.

>When writing I don't have a clue what oParent is. It could be a form, a grid, a container, a toolbar, _screen. I don't know what type of object has been added to the form etc... I don't care here either.
>
>The point is however, that in particular cases you don't give a hoot about its type, because YOU AS A PROGRAMMER know that certain properties and methods do exist, and telling the compiler the same might be very difficult. This is the reason virtual classes and virtual methods exist. You'll have to bend everyhting into making the compiler happy because it wants to know all at compile time.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform