Results 1 to 7 of 7

Thread: Variable Question: Use variable value to set another variable of that values name

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2007
    Posts
    63

    Question Variable Question: Use variable value to set another variable of that values name

    Okay here's my question.

    How would I use a variables value to be used to set or get another variables value?

    Here's an example.

    Let's say I have 3 variables but actually have many more

    House = "Big"
    Car = "Fast"
    Pet = "Dog"

    Now I have a function that queries a table to get some data and one of the fields is a variable name such as Pet

    something like

    VariableCheck = GetVariableFieldValue() // This returns Pet

    so VariableCheck = Pet

    So rather than having a Huge select case statement such as:

    Select Case VariableCheck
    Case "House"
    txtValue.text = House
    Case "Car"
    txtValue.Text = Car
    Case "Pet"
    txtValue.Text = Pet
    End Select

    I need some kind of varValueVariable function.

    txtValue.Text = VarValueOf(VariableCheck)

    and a set value of vunction

    SetVarValueOf(VariableCheck) = "Cat"


    Thanks for all your help
    Last edited by Mythos44; Jul 8th, 2010 at 02:05 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width