Set TCL variables based on thread name

Clovertech Forums Read Only Archives Cloverleaf Tcl Library Set TCL variables based on thread name

  • Creator
    Topic
  • #54569
    Tyler Bouma
    Participant

      Hello, I am in need of a TCL script that can look at the its sending thread properties and set a variable based on the thread name.

      I have found a few topics mentioning a netconfig proc that allows for variables to be set based on the sending thread. But, I have not been able to find anything concerning this use case.

      More specifically what I am trying to do is set an MSH field with an arbitrary value based on what thread is sending the message.

      Any help is greatly appreciated.

      Thanks

    Viewing 2 reply threads
    • Author
      Replies
      • #82023
        Keith McLeod
        Participant

          Here is something I had used in a translate.

          copy @null using the following preproc

            set xlateOutVals [xpmmetaget $xlateId DESTCONN]

          to a variable @destconn

          I think in your case it might be something like

          copy @null using the following preproc

            set xlateOutVals [xpmmetaget $xlateId SOURCECONN]

          to a variable @sourceconn

          You could then make your decisions based on the value of @sourceconn for your MSH fields….

          Hope this helps….

        • #82024
          David Barr
          Participant

            In a TPS proc you can use [msgmetaget $mh SOURCECONN] to get the source thread name.

          • #82025
            Tyler Bouma
            Participant

              Thanks for both of your answers, David’s answer actually worked out perfectly for what I am doing.

          Viewing 2 reply threads
          • The forum ‘Tcl Library’ is closed to new topics and replies.