5.5 Bug or my ignorance about TCL variables in Xlate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf 5.5 Bug or my ignorance about TCL variables in Xlate

  • Creator
    Topic
  • #51305
    Sam Craig
    Participant

      Ok, will try to make this short.

      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 😳

    Viewing 1 reply thread
    • Author
      Replies
      • #69621
        Troy Morton
        Participant

          Technically, you are right the value should not persist, I think.

        • #69622
          Sam Craig
          Participant

            Troy, thanks for the info on the cconcat command.

            I will have to “play” with it and give it a shot.

            Always good to have more “tools” in the toolbox.

            Thx,

            Sam 🙂

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.