Results 1 to 2 of 2
  1. #1
    Gold Lounger
    Join Date
    Jun 2001
    Crystal Beach, FL, Florida, USA
    Thanked 41 Times in 40 Posts
    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
    GetGlobalValue = eval(VariableName)
    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.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts
    [quote name='MarkLiquorman' post='762239' date='27-Feb-09 17:12'][/quote]
    See this post by Support4John for an alternative solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts