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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extract a string version of a constant’s name???

Status
Not open for further replies.

apostolisadam

Programmer
Jan 26, 2005
5
US
In Delphi, does anyone know of a way to extract a string version of a constant’s name?

const

myConstant = 1;
...
MyTextValue := SomConversionToText( myConstant );

showMessage( ‘The name of the constant is: ‘ + MyTextValue );


Is it even possible?
 
I think you because the name is only known at compile time, not at runtime. why would you need something like this?
if you want to link an integer value to a string there are many ways, like arrays and so on. I personally use a small database table for such purposes...


--------------------------------------
What You See Is What You Get
 
I think its not possible you because the name is only known at compile time, not at runtime. why would you need something like this?
if you want to link an integer value to a string there are many ways, like arrays and so on. I personally use a small database table for such purposes...

--------------------------------------


--------------------------------------
What You See Is What You Get
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top