?
Solved

variables of variables (references)

Posted on 2003-03-23
5
Medium Priority
?
142 Views
Last Modified: 2010-05-01

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"
0
Comment
Question by:fegonzal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Expert Comment

by:Sweat
ID: 8191082
fegonzal,

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

Sweat

0
 
LVL 2

Expert Comment

by:Jacamar
ID: 8191591
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
0
 
LVL 11

Expert Comment

by:supunr
ID: 8191743
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!
0
 
LVL 9

Accepted Solution

by:
GivenRandy earned 225 total points
ID: 8192537
0
 

Author Comment

by:fegonzal
ID: 8193109
thanks GivenRandy, is a good example..
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question