When you want to use one of the incoming values you must select it from the LIST of input values in xlateInVals. When you are building your list of output values you must build xlateOutVals accordingly. This holds true even if there is only a single value in the list.
Unless you want to make a copy of the entire list, do NOT use:
set ex $xlateInVals
To get the first element of the list, even if it is the only element in the list, use:
set ex [lindex $xlateInVals 0]
To get the second element of the list use:
set wy [lindex $xlateInVals 1]
To get all the individual elements of the list at the same time in a single statement, you could use:
lassign $xlateInVals ex wy
Why are xlateInVals and xlateOutVals lists? Because they can hold multiple values. If you have multiple source addresses in the Source side of an Xlate COPY statement, each of those addresses corresponds to a list element in xlateInVals. You can also have multiple addresses in the Destination side of that COPY statement. Each list element of xlateOutVals corresponds to one of the destination addresses. There are many ways to build lists. Note the quotes and the space between the two
Code:
set xlateOutVals “[list $ex] [list $wy]”
Another way to build xlateOutVals could be
set xlateOutVals {}
lappend xlateOutVals $ex
lappend xlateOutVals $wy
Both