I do some contract work for a software house that has an application that relies heavily on global variables for settings (such as security settings), etc. It is incredibly cumbersome, and I’m trying to come up with a way to simplify some of it.
I’m looking at a situation in which the particular Global Variable I need is not fixed, rather I’m getting the name of the variable as a string. I can’t seem to figure out a way get the value of the variable using the string name.
I was hoping to do something like this, but it didn’t work:
Public Function GetGlobalValue(VariableName) as variant
[indent]GetGlobalValue = eval(VariableName)[/indent]
end Function
Like I said, it didn’t work, but I think you can get the idea of what I want to do. Is anything like this possible? The alternative seems to be a huge SELECT CASE clause.