Originally posted by Weston Olmstead
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