Recently found that TCL variables used in a translation are still intact after the translation is finished.
I always thought the TCL variables used in Pre Procs were “reset” or wiped out after each message translation completed.
Here is the example:
Manipulating date/time stamp. If hour and minutes equal 0000, then change to 000100. Make it 1 minute past midnight and zero seconds.
Take 20091031000017 and make it 20091031000100.
But, we had a date/time field that came out looking like this after a few days: 20091026000100200910260001002009102600010020091026000100200910310001002009103100010020091103000100
Here is Pre Proc TCL code in a COPY statement in Xlate.
set datein7 [lindex $xlateInVals 0]
set datein7 [csubstr $datein7 0 8]
append datein8 $datein7 “000100”
set xlateOutVals $datein8
When run thru XLT testing tool, all works OK.
But, as you can see, after a few days in prod it kept the date/ time stamp from the 26th, 31st, and the 3rd in the datein8 variable and kept appending the next date/time stamp.
Had to add this set command as 1st line in code to stop the undesirable results:
set datein8 “”
So, is this normal (my ignorance) or a bug in Cloverleaf 5.5 version?
Help,
Sam