Re: 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

Re: Dynamic variables and lists

From: Donald Arseneau <asnd@triumf.ca>
Date: Wed Jun 29 2005 - 21:53:20 CEST

ssriperu1@yahoo.com writes:

> power
> % set ${a} [list a b c d]

so you set the variable power to a list

> a b c d
> % set second [lindex ${a} 1]

and try to look up the second list item in the string "power".

> % set second [lindex eval ${$a} 1]
> can't read "$a": no such variable

http://wiki.tcl.tk/8662

-- 
Donald Arseneau                          asnd@triumf.ca
Received on Thu Sep 29 14:23:51 2005