The value of a variable (String type) is the name of a variable 
Author Message
 The value of a variable (String type) is the name of a variable

Hello All,

I'd really appreciate any help you could give me!
I need to be able to read the value of a variable and use this value as the
name of a variable.

Example:
Dim strNameVariable As String
Dim strStreet As String
strNameVariable = "Street.text"

strStreet = ?Function(strNameVariable)
Wich function to use so that strStreet = Street.text?

Thanks very much



Mon, 23 Feb 2004 05:20:41 GMT  
 The value of a variable (String type) is the name of a variable

Quote:
> I'd really appreciate any help you could give me!
> I need to be able to read the value of a variable and use this value as
the
> name of a variable.

Peter,

Although I don't have any VB.NET docs in front of me right now, I believe
the old "CallByName" function still exists. Try looking it up in the VB.NET
help and it should give you what you want.

If it doesn't exist, sorry for the miss-information. :-(

--
Regards,
Cal



Mon, 23 Feb 2004 05:52:05 GMT  
 The value of a variable (String type) is the name of a variable
Peter,

Sorry, after rereading your question, CallByName will not work. To my
knowledge, there is not a way to refer to a variable by it's textual (i.e.
String) name. You could create a Collection and use the Variable name as the
Key and then store the value for the variable in the element of the
collection associated with that Key.

Anyone else have any good Ideas?
--
Regards,
Cal



Mon, 23 Feb 2004 05:54:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Cannot assign a variable declared as a string to a variable declared as data type

2. converting an object variable (name of a file) into a string variable

3. building a string into a variable then text variable as a control name

4. Variable Name to Variable value.

5. Variable values as variable names

6. Change the value of variable wich the name is in another (string)

7. Can I use the value of String var as Variable name

8. Automatic capitalization of variable names, type names, subs and functions

9. How do I map a string to a multi variable string type

10. Largest Variable for the Long variable type

11. Type mismatch when comparing session variable to page variable

12. Variable type of variable?

 

 
Powered by phpBB® Forum Software