Sorting Array?
- From: g4173c@xxxxxxxxxxxx
- Date: 17 Aug 2006 08:02:01 -0700
Hi:
New to TCL here and I'm trying the following:
array set lang {0 undefined 1 critical 2 major 3 minor 4 informational
5 ok 81 debug}
#
foreach key [lsort -index 0 [array get lang]] {
puts "$key : $lang($key)"
}
I know that with a hash table I won't get the order out 0, 1, 2, etc..
so I'm sorting first,
however, obviously I'm not doing this correctly because I get:
can't read "lang(critical)": no such element in array
while executing
Which tells me I'm really not doing a key,value pair here. Could
someone point me in the right direction.
Thanks
Tom
.
- Follow-Ups:
- Re: Sorting Array?
- From: Tom Conner
- Re: Sorting Array?
- From: Robert Heller
- Re: Sorting Array?
- From: Glenn Jackman
- Re: Sorting Array?
- Prev by Date: Re: Running KDE or Gnome? <ebqucb$26g$1@nemesis.news.tpi.pl> <1155721858.278188.227490@i3g2000cwc.googlegroups.com> <1155728435.781804.251260@b28g2000cwb.googlegroups.com> <ec00pd$ma7$1@nemesis.news.tpi.pl> <yfisljwhwah.fsf@triumf.ca> <ygahd0bdc5y.fsf@panther.akutech-local.de> <ec1cq1$4tv$1@srv.cyf-kr.edu.pl>
- Next by Date: Re: unix shell command length limit
- Previous by thread: Basic question regarding TCL
- Next by thread: Re: Sorting Array?
- Index(es):
Relevant Pages
|