set site from within tcl

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf set site from within tcl

  • Creator
    Topic
  • #48125
    John Mercogliano
    Participant

    I’m attempting to run hcidbdump from with in a tcl script against all sites to check the error database for any transactions the previous day.  My question is, how do you set the site from within tcl so that hcidbdump will run correctly.

    Thanks,

    John Mercogliano
    Sentara Healthcare
    Hampton Roads, VA

Viewing 4 reply threads
  • Author
    Replies
    • #57724
      Anonymous
      Participant

      I use:

      eval [exec -keepnewline $HciRootDir/sbin/hcisetenv -site tcl $site]

    • #57725
      John Mercogliano
      Participant

      Thanks Matt, it was exactly what I needed. 😀

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

    • #57726
      John Mercogliano
      Participant

      Don’t know if anyone has seen this but if you have could someone tell my why this works.

      I implemented Matt’s solution using eval and it worked great from with in hcitcl or in a .tcl file when called from the top level but when I tried to call it from a function it would not work.  

      I ended up changing eval to uplevel #0 and it worked again. My question would be, why does hcisetenv need to be run from the root proc.

      Thanks,

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

    • #57727
      Rob Abbott
      Keymaster

      The code sets up the env array, which exists in the root scope.  Inside a proc you need to declare it global.  Did you global env in your proc?

      Rob Abbott
      Cloverleaf Emeritus

    • #57728
      John Mercogliano
      Participant

      That was it.  It never dawned on me to global env.  I’m used to globaling when I’m interacting directly not indirectly through a system call.

      Thanks,

      John Mercogliano
      Sentara Healthcare
      Hampton Roads, VA

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

Forum Statistics

Registered Users
5,127
Forums
28
Topics
9,299
Replies
34,443
Topic Tags
288
Empty Topic Tags
10