Ho do I specify multiple values to a key in Tcl associative array?
set A(a) val1
set A(a) val2
This is overriding the value and, on printing, I get the last value. How to store and to retrieve both of them?
You could store the values in a list, and store that list into the array:
set A(a) [list val1]
lappend A(a) val2
puts $A(a)
# val1 val2
lappend for all. The lappend command will behave the same as the set/list combination shown in the code above if the array element does not exist.