Get Const. Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have a module that contains a large list of Constants (e.g. Const alert1
as Integer = 123), and I have a function that returns an "alert" number as
integer (e.g. 123). Is there a way to present to the user the name of that
constant returned by the function according to the constants list (e.g.
"alert1"), instead of just presenting a numeric value returned (e.g. 123)?

In other words, can I have a reverse mapping of a constant value and its
corresponding constant name?
 
Amjad said:
I have a module that contains a large list of Constants (e.g. Const alert1
as Integer = 123), and I have a function that returns an "alert" number as
integer (e.g. 123). Is there a way to present to the user the name of that
constant returned by the function according to the constants list (e.g.
"alert1"), instead of just presenting a numeric value returned (e.g. 123)?

Use an enumeration type (keyword 'Enum').
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top