Originally posted by Bryan Dort
OK...I give up...I don't understand. I'm doing a simple xlate tcl and having trouble with it. From previous listserv messages, I've created a tcl to format a field with leading zeros (Thanks Eric). Here is the problem:
I'm using this tcl:
proc xlt_formatsetid {} {
upvar xlateId xlateId
xlateInList xlateInList
xlateInTypes xlateInTypes
xlateInVals xlateInVals
xlateOutList xlateOutList
xlateOutTypes xlateOutTypes
xlateOutVals xlateOutVals
set xlateOutVals [list [format "%04d" [lindex $xlateInVals 0]]]
}
with the xlate COPY looking like
PRE
xlt_formatsetid
SOURCE
@dg1setidDESTINATION
0(0).DG1(%s9).00375.[0]
So, in the testing tool, I get a setid without leading zeros with the above.
If I change add another SOURCE value so it looks like:
SOURCE
=ANYTHING
@dg1setidand change the tcl to look at the second value of the list (index 1), then it formats correctly and I get the leading zeros. What gives?
3.8.1P Rev 4 on Windows 2000