Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The creature that won't die
Message
From
24/03/2010 02:55:03
Walter Meester
HoogkarspelNetherlands
 
 
To
23/03/2010 18:22:22
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
VFP Compiler for .NET
Miscellaneous
Thread ID:
01456123
Message ID:
01456849
Views:
77
>>(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.

Ouch how could I forget, after you stumped me in the face with that more than once :) ?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform