• Referencing Global Variables

    Author
    Topic
    #457885

    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.

    Viewing 0 reply threads
    Author
    Replies
    • #1149426

      See [post=”198890″]this post by Support4John[/post] for an alternative solution.

    Viewing 0 reply threads
    Reply To: Referencing Global Variables

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: