Prev: AsHexString
Next: Intersting development
From: Stefan on 18 Jan 2010 09:57 Hello, how can I know the value of a constant, when I have the name of the constant as a literal string. For example: define ID_CONSTANT := 100 cVar := "ID_CONSTANT" Using the makro operator doesn't work.
From: E®!k /!sser on 18 Jan 2010 10:25 Stefan, You cannot. Constants are resolved at compile time, there is no way to find out the name at runtime. hth Erik "Stefan" <info(a)sanosoft.com> schreef in bericht news:e1106ecb-098d-4986-a7f9-df2d380d2435(a)j5g2000yqm.googlegroups.com... > Hello, > > how can I know the value of a constant, when I have the name of the > constant as a literal string. For example: > > define ID_CONSTANT := 100 > > cVar := "ID_CONSTANT" > > Using the makro operator doesn't work.
From: dlzc on 18 Jan 2010 21:51 Dear Stefan: On Jan 18, 7:57 am, Stefan <i...(a)sanosoft.com> wrote: > Hello, > > how can I know the value of a constant, when I > have the name of the constant as a literal > string. For example: > > define ID_CONSTANT := 100 > > cVar := "ID_CONSTANT" > > Using the makro operator doesn't work. You could add this line: xID_CONSTANT := ID_CONSTANT > cVar := "xID_CONSTANT" This would work. Obtuse, but it would work. David A. Smith
From: Geoff Schaller on 23 Jan 2010 20:41 cVar := AsString(ID_CONSTANT) "Stefan" <info(a)sanosoft.com> wrote in message news:e1106ecb-098d-4986-a7f9-df2d380d2435(a)j5g2000yqm.googlegroups.com: > Hello, > > how can I know the value of a constant, when I have the name of the > constant as a literal string. For example: > > define ID_CONSTANT := 100 > > cVar := "ID_CONSTANT" > > Using the makro operator doesn't work.
From: Geoff Schaller on 23 Jan 2010 20:44 Sorry - re-reading your post. No, you cannot. And it makes no sense to do so. If you want to do something like this then use Joachim Bieler's enumerator class: bNameArray. It is fully documented and works a treat. Geoff "Stefan" <info(a)sanosoft.com> wrote in message news:e1106ecb-098d-4986-a7f9-df2d380d2435(a)j5g2000yqm.googlegroups.com: > Hello, > > how can I know the value of a constant, when I have the name of the > constant as a literal string. For example: > > define ID_CONSTANT := 100 > > cVar := "ID_CONSTANT" > > Using the makro operator doesn't work.
|
Pages: 1 Prev: AsHexString Next: Intersting development |