The purpose of Const is just to give a name to a value so it's easier to read. I think the Const names in your code are just replaced by their values before it is compiled.
If you need to have a relation between "key" and "value", maybe a hash algorithm. In the code archives I only found a Map: http://www.blitzbasic.com/codearcs/codearcs.php?code=2574 But a hash should be faster.
As a string parameter to a function, you input the value of the const and it is used as the key to retrieve the name of the const. But this is a manual solution, you'd have to register the name of each value in the hash at the start of your program.
|