So for the following code, I have a varName set of “threadList”, and it is a list equal to “thread1 thread2 thread3”
I have two arrays defined, each one has 5 identically named elements. The array names are thread1, and thread3
tcl> array names thread1
recBSnd recNSnd recTime recBRec recNRec recSite
tcl> array names thread3
recBSnd recNSnd recTime recBRec recNRec recSite
tcl> puts $threadList
thread1 thread2 thread3
foreach thrd $threadList {
if {[info exists $thrd]} {
append $sep $thrd(recBSnd) $sep $thrd(recBRec)
}
}
My problem is arrays have to be referenced via the array name. The array name (for the first run through) is “thread1”.
puts $thread1(recBSnd)
returns a value. But I don’t know how to reference the array name by using a variable name.
Any help would be appreciated.
Thanks
Todd