Convert String to variable contained in string

Tech-Archive recommends: Fix windows errors by optimizing your registry



I have a situation where I have the name of a variable in a string and would
like to get the value of the variable.

Simple Example:

string varName = "MyClass.intvalue";

would like to get value of MyClass.intvalue.

I tried
int ret = Int32.Parse(varName);
but this fails because it sees that the string doesn't contain a number.

-Gregory McCallum
.



Relevant Pages

  • Extracting data from dump file
    ... I tried using the python csv method, ... just sends the whole thing as a string and the SQL INSERT ... fails with a "not enough args" error. ... using; as a delimiter and going back to csv; this fails to match ...
    (comp.lang.python)
  • Re: String concatenation function, request for comments.
    ... Well, here you are starting at the right end, the interface to your ... so it never fails barring memory exhaustion. ... string, so you can confidently pass the non-null results onward. ... You are also confident that the returned item can be passed to ...
    (comp.lang.c)
  • Re: Linked Table Properties - using ODBC trying to rmv DATABASE NAME e
    ... > However, when I move it to my staging machine, the database Onyx_Dev ... > is no longer there and it fails. ... the provider's help file (for SQL Server, probably look in the Books On ... You haven't put any password string in the Connect string you posted: ...
    (microsoft.public.access.tablesdbdesign)
  • RE: Code fails, but then works!
    ... I reckon it fails because you are calculating your strWHO variable before ... Dim StrFullname As String ...
    (microsoft.public.access.formscoding)
  • Re: BInding operator fails
    ... I made the changes that A.R. Ferreira suggested and it fails. ... use strict; ... use warnings; ... print "String is there\n"; ...
    (perl.beginners)