[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Loop properties from a class from a method in that class

  • Thread starter Thread starter Lieven De Foor
  • Start date Start date
Status
Not open for further replies.
L

Lieven De Foor

Guest
It appears you can't get the value of a private property through reflection, which is a weird design choice, since you can with Java or C#... USING Progress.Reflect.Flags FROM PROPATH. USING Progress.Reflect.Property FROM PROPATH. BLOCK-LEVEL ON ERROR UNDO, THROW. CLASS TestReflection.TestReflection: DEFINE PRIVATE PROPERTY PrivateProperty AS CHARACTER NO-UNDO INITIAL "Hello!" GET. SET. METHOD PUBLIC VOID PrintPrivates(): DEFINE VARIABLE Properties AS Property NO-UNDO EXTENT. Properties = GetClass():GetProperties(Flags:Private OR Flags:Instance OR Flags:DeclaredOnly). MESSAGE Properties[1]:Name SKIP Properties[1]:Get(THIS-OBJECT) VIEW-AS ALERT-BOX. END METHOD. END CLASS.

Continue reading...
 
Status
Not open for further replies.
Back
Top