I am transliterating a program into tcl. The program used arrays in the main and in the function of the same name and I followed suit.
I got warning messages that in the function the array was undefined. OK so I used "upvar xy xy" and that worked.
Now I notice that another array similarly set up (and upvar-ed in the function) is undefined in the main but it is un-defined in the main even tho it is given a value in the function and the function is called before the statement where TCL thinks the array element: is undefined.
Is there a simple solution to this ?