Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with arrays!!!

Status
Not open for further replies.

sergelaurent

Technical User
May 30, 2005
52
FR
I have the following code:

#I have variable containing :
#array set toto [list {0} {} {1} {tom tim tam} {2} {fom fim fam}]
set var [lindex toto {2 1}]
puts $var

I expected to get "fom" but i got a bug!!!

Can someone tell me how I can extract information from my list "toto"?
 
Hi

I think you mess up the things and tried to combine arrays and lists. Which obviously does not work that way.

No idea what you want, but you can get fom this way :
Code:
[blue]%[/blue] array set toto [list {0} {} {1} {tom tim tam} {2} {fom fim fam}]
[blue]%[/blue] puts [lindex $toto(2) 0]
fom

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top