Dynamic-Cast/Dynamic-New

Posted by Freddy Boisseau on 25-Sep-2008 13:01

I am trying to figure out the dynamic-cast and dynamic-new. I have written a class that my programmers will use normally, but I want them to be able to change the the class that is used if they need to. I also want them to be able to access any methods in the sub-class they define. Basically here is what I have right now.

DEFINE VARIABLE customClass AS sms.lib.customClass NO-UNDO.

DEFINE VARIABLE cName AS CHARACTER NO-UNDO.

update cName.

customClass = DYNAMIC-NEW cName ( ).

Now using that I can access the class and the methods in the super class, but I can not access the methods defined in the sub class. Now I know that I need to use the dynamic-cast, but I am just getting used to OO Programming and the documentation is not very clear to me. Can anyone give me pointers on how to do this?

Message was edited by:

Frederic Boisseau

All Replies

This thread is closed