Dynamic variables and lists
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Dynamic variables and lists

From: <ssriperu1@yahoo.com>
Date: Wed Jun 29 2005 - 21:25:48 CEST

Here's my problem:

% set a power
power
% set ${a} [list a b c d]
a b c d
% set second [lindex ${a} 1]
% puts $second
# prints nothing
% set second [lindex eval ${$a} 1]
can't read "$a": no such variable
% puts $a
power
% set second [lindex eval $a 1]
bad index "power": must be integer or end?-integer?

How do I get access to the $power list without specifying "power" ?

Any help is appreciated. Thanks.
Received on Thu Sep 29 14:23:50 2005