AXMIM
AXMIM

Reputation: 2472

Progress equivalent of c# myVariable.GetType().Name?

Is there a Progress equivalent for C# myVariable.GetType().Name?

With an interface or a base type variable, can we find back the name of the real type instanciated?

ShowRealType(NEW myUserDefinedError()).

METHOD PUBLIC VOID ShowRealType(viError AS Progress.Lang.ERROR):
    MESSAGE /***** NEED CODE TO FIND THE REAL TYPE OF viError here ******/        VIEW-AS ALERT-BOX.
END METHOD.

I've tried viError:GetClass():ToString(), but its gives Progress.Lang.Class_1025 instead of myUserDefinedError.

Inheritance

Upvotes: 0

Views: 426

Answers (1)

nwahmaet
nwahmaet

Reputation: 3909

You can do something like

METHOD PUBLIC VOID ShowRealType(viError AS Progress.Lang.ERROR):
    // validate that it's really an object
    if valid-object(viError) then
    MESSAGE viError:GetClass():TypeName
        VIEW-AS ALERT-BOX.
END METHOD.

Upvotes: 2

Related Questions