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

Status
Not open for further replies.
L

Lieven De Foor

Guest
For some reason my answers don't get posted, so this is another (3rd) attempt... It appears the value of private properties can't be read using reflection, which is a strange design choice, since this is possible in Java or c#... Example code: 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.
Top