Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

variables of variables (references)

Posted on 2003-03-23
5
Medium Priority
?
143 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
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

580 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