On Apr 22, 2006, at 6:49 PM, Marc Van Olmen wrote:

Hi,

is there a trick to store a class in a Variable and do new with it Maybe some code will clarify?

Dim aClass as CLASS;
dim anObject as MyClass;
        
  aClass = MyClass



   anObject = new aClass

-----------------------------------------

Because infact what I want to accomplish is the following:
        
        aNewDict = new Dictionary
        
        aNewDect.Value("MyClass") = MyClass
        aNewDect.Value("MyClass1") = MyClass1
        

and then somewhere i can use that to create an object.

        
        aType = self.ReadFromFileType
        anObject = new (aNewDict.Value(aType)

Currently I'm doing this with select case....
but looking for other solution.

Implementing (or faking) the ability to override the New operator is essentially the point of Factory and other creation patterns.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to