Reply To: Post Xlate tcl

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Post Xlate tcl Reply To: Post Xlate tcl

#58031
David Harrison
Participant

    Thanks for the suggestions. It’s now dawned on me what I was doing wrong. When I used the proc pre Xlate it was only returning the date not the time. This was because I was only taking the first value in the list. I’ve now modified it to work pre Xlate.

    ######################################################################

    # Name: XltFormatDateTime

    # Purpose: Format Date & Time eg 20.12.0512:15 to 200512201215.

    #

    # UPoC type: xltp

    # Args: none

    # Notes: All data is presented through special variables.  The initial

    #   upvar in this proc provides access to the required variables.

    #

    #  This proc style only works when called from a code fragment

    #  within an XLT.

    #

    # v1  DTH 20/12/2005 Initial Version.

    proc XltFormatDateTime {} {

     upvar xlateInVals   xlateInVals

       xlateOutVals  xlateOutVals

     set x [lindex $xlateInVals 0]

     set y [lindex $xlateInVals 1]

     set Dtc 20

     set Dtd [string range $x 0 1]

     set Dtm [string range $x 3 4]

     set Dty [string range $x 6 7]

     set Tmh [string range $y 0 1]

     set Tmm [string range $y 3 4]

     set x $Dtc$Dty$Dtm$Dtd$Tmh$Tmm

    echo >$x<  set xlateOutVals

      }

      Merry Christmas from England,

      Dave