Link to home
Start Free TrialLog in
Avatar of fegonzal
fegonzal

asked on

variables of variables (references)


Hi,

I have a two string variable:
A = "I need this"
B = "A"

Ok, I need a function like this:
evaluate(B) -> "I need this"

thank all

(spanish)
Tengo una variable string y en otra variable string tengo almacenado el nombre de la primera, como puedo acceder al valor de la primera sabiendo su nombre desde el string de la segunda?

Un ejemplito.. A="lo que quiero saber" B="A" necesito una funcion, que ingresandole B me devuelva "lo que quiero saber"
Avatar of Sweat
Sweat

fegonzal,

I think you're going to need to be a little more descriptive as to what you are asking.

Sweat

Well, if you want to you use that value in a sub procedure, you can do it like this

Call Evaluate(B)




then you have your sub procedure as follows


Private sub Evaluate(B as string)
'do whatever
End sub
Call Evaluate(B)

Private sub Evaluate(ByRef B as string)
    if (B = "A") then
        B = A
    elseif (B = "C") then
        B = C
    ' etc.
    end if
End sub

Is this what you want?

Good Luck!
ASKER CERTIFIED SOLUTION
Avatar of GivenRandy
GivenRandy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fegonzal

ASKER

thanks GivenRandy, is a good example..