Hi Thanks to Donal for his recommendation to change

from set sizes [array names sizeNum] to set sizes [lsort -ascii [array names sizeNum]]

Now I wonder how do I sort based on sIdx ? meaning, I would like it to come out the same
order as inserted. This will solve my problem period.


From: David Wang <kuoweiwang@yahoo.com>
To: "tcl-gsoc@lists.sourceforge.net" <tcl-gsoc@lists.sourceforge.net>
Sent: Wednesday, February 26, 2014 5:58 PM
Subject: New to tcl

Hi

I have the following code in tcl and I am new to this language.
Say the following lines get inserted
reset
tW
failure

// used to insert the lines above
foreach f [$par listof names] {
  set sizeNum($f) $sIdx             
  incr sIdx
}

However, this following code prints out the lines in a different order
failure
reset
tW

set sizes [array names sizeNum]
foreach s $sizes {
set sIdx $sizeNum($s)
    addlines "[$s cget -name]"
}

Is there a way I can find out what hashing function it uses to
print out the lines in the order it is?

Thanks

David