| Reply | « Previous Thread | Next Thread » |
|
Sorry,
Too late to think, so I'll ask and hope for the best: I can easily generate text string name of a variable, for example "variable42". How do I get the value of such variable, using that text string: variable42 = 12 variableName = "variable42" variable42 = 24 variableName = "variable42" Is there an easy way? If not, then I'll avoid this problem by rewriting something... Good night, --jouni |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
Sorry, couldn't understand the question very well. But, maybe the solution is using eval(): Code:
variable42 = 12
print eval("variable42") # prints 12
Rafael. |
|
Never used eval before, many thanx for the introduction !!!
However it's too late, I already rewrote that part of the code ![]() Cheers, --jouni who will have to take a good look at eval() |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Using a variable exported by a dll in a local variable: crash | alban_c | General Symbian C++ | 5 | 2008-02-21 20:04 |
| Strange Compilation error: fatal error: error writing to -: Invalid argument | Evgeniz | General Symbian C++ | 4 | 2007-05-31 08:06 |
| Parsing file content | hendrawan.ashari | General Symbian C++ | 7 | 2007-03-09 11:41 |
| load multiple images using 1 CFbsBitmap variable result in same image | Rx-lee | General Symbian C++ | 1 | 2006-11-15 08:03 |
| static variable problem | plmanikandan | General Symbian C++ | 1 | 2005-01-30 03:29 |