Is there any way to programatically get information about a class that has not been loaded (New'd)?. This would be similar to how the Class Browser shows Member and Inherits information for a class.
For example, I have a form where I would like to see if it's inheriting some base class, but without performing myForm = NEW NameSpace.FormName( ). If the form has been loaded using NEW, I can use the following to get at the information:
DEFINE VARIABLE myType AS System.Type NO-UNDO.
myType = Progress.Util.TypeHelper:GetType("NameSpace.FormName")
NO-ERROR.
myType:BaseType:ToString( ) returns the class that my form is inheriting.
I'd like to do the same without loading the form.
Thanks!
Jim
jim.litzie wrote:
Is there any way to programatically get information about a class that has not been loaded (New'd)?. This would be similar to how the Class Browser shows Member and Inherits information for a class.
For example, I have a form where I would like to see if it's inheriting some base class, but without performing myForm = NEW NameSpace.FormName( ). If the form has been loaded using NEW, I can use the following to get at the information:
DEFINE VARIABLE myType AS System.Type NO-UNDO.
myType = Progress.Util.TypeHelper:GetType("NameSpace.FormName")
NO-ERROR.myType:BaseType:ToString( ) returns the class that my form is inheriting.
I'd like to do the same without loading the form.
Thanks!
Jim
Yes, this is reasonably straightforward. You should be able to do this:
DEFINE VARIABLE myClassReference AS progress.lang.class NO-UNDO.
myClassReference = Progress.Lang.Class:GetClass("namespace.FormName").
IF VALID-OBJECT(myClassReference) THEN
MESSAGE myClassReference:SuperClass:TypeName
VIEW-AS ALERT-BOX.
Perfect!!!
Thanks Phillip.