TCL called from xLate not returning output but echo works

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf TCL called from xLate not returning output but echo works

  • Creator
    Topic
  • #54374
    Weston Olmstead
    Participant

      Looking for some feedback on a TCL script I have, and what I’m likely doing wrong. I have a TCL I’m attempting to write that uses the “showroot” command, parses that string to identify the current site and returns that string back to the xLate.

      I’m attempting to do this because I have some xLates that are reused but have some minor logic differences based on site so I need to know what site I’m in.

      Whnever I “echo” my variable in the testing tool, I get the correct value, but when I have it mapped to a field and call theTCL from within my xLate, it doesn’t return my value.

      I have tried returning the unparsed string (which worked), so I’m thinking its a type casting issue. I tried making the xLateOutVals a list (as seen below) which didn’t seem to resolve the issue.

      Any feedback is appreciated.


      Sample return from showroot

      HCI root is {D:xxxxxxxxxxquovadxcis5.8integrator} HCI site is test_site

      The echo of my variable returns “test_site”


      Code:

      proc xlt_print_cloverleaf_site {} {

         upvar xlateInVals xlateInVals xlateOutVals xlateOutVals xlateId xlateId

      #Capture Currentroot & site

      catch {exec cmd /c call showroot} currentPath

      set RawString [split $currentPath]

      echo $RawString

      set SiteName [lindex $RawString 7]

      echo $SiteName

       set xlateOutVals  

           

        }

    Viewing 1 reply thread
    • Author
      Replies
      • #81218
        bill bearden
        Participant

          Not sure why it isn’t working. I just tested it and I was able to change the upvar’ed xlateOutVals in a tclproc and echo it after it got back to the xlate. We are on CL 6.0 but I would be surprised if a different version would make a difference.

          But… You might also try just referencing the variable, $HciSite. It might already contain what you are looking for.

        • #81219
          Weston Olmstead
          Participant

            Bill,

            “set xlateOutVals

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