Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get a property value using a string

Status
Not open for further replies.

rcloutie

Programmer
May 26, 2005
164
CA
Hi all,

Is there any way to get / set a property value using a string identifier?

Something like:
Code:
     oMyClass.Properties('CalcValueX') := x;
     x := oMyClass.Properties('CalcValueX');
instead of:
Code:
     oMyClass.CalcValueX := x;
     x := oMyClass.CalcValueX;

The point is that all properties are inserted into a TStringGrid which one column is dedicated to the property name. Using this column, I would like to set directly new values into my object (MyClass). Actually there's a bunch of [if else if] to check each property names but I don't like it.

Thanks a lot in advance,

RC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top