Translating string values to string names

Drstein99

Junior Contributor
Joined
Sep 26, 2003
Messages
283
Location
Audubon, Nj
I'm porting an application from FoxPro 2.5, to .net 2003. At many points in the application, I'm translating string to variable. For example:

esString1 = "BlowFish"
esString2 = "esString1"

print "string 1: " + esstring1
print "string 2: " + esstring2
print "REFERENCE string2:" + &esstring2
esString1 = "Changed"
print "REFERENCE again string2:" + &esstring2

--------- Program Output ---------------

string1: BlowFish
string2: esString1
REFERENCE string2: BlowFish
REFERENCE again string2: Changed

----------------------------------------------

Putting "&" in front of any string will cause the program to access the value of that string instead.

Does anybody know how this works in Visual Basic .net? If I'm not being clear, please ask to clairify - thanks.
 
Im not really sure what you are trying to do, both things will print the same thing anyway. You are accessing the value of string, it is the text that is in it.
Sorry If im completely misunderstanding you :)
 
"&"

If I put & in front of any string in foxpro, it will translate to the value of the string. NOT the numeric value, but the referenced value.

so, if s1 = "examples1", and s2="s1", s1=&s2

Understand?
 
Back
Top