Stupid Question

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Stupid Question

  • Creator
    Topic
  • #48885
    garry r fisher
    Participant

      Hi,

      I’m reading somebody elses Tcl code and they have used the following:

      set dipList “KILL $mh”

      msgset $mh “A Message”

      set dispList “CONTINUE $mh”

      Is this allowed? If I’ve killed the mh how can it then be continued?

      Thoughts please as I have to write a report on the interface and recommend changes to a client (if necessary).

      The interface does work.

      Regards

      Garry

    Viewing 4 reply threads
    • Author
      Replies
      • #60000
        Matt Estrella
        Participant

          Hello Gary,

          Look for an IF statement or other condition within the tcl procedure where dipList is evaluated. Here’s an example:

          if [cequal $filter “ER”] {

                        lappend dispList “CONTINUE $mh”

                     } else {

                        lappend dispList “KILL $mh”

                     }

          Hope this helps.

        • #60001
          James Cobane
          Participant

            Garry,

            The message would ultimately be KILL’d if the dispList was set to “KILL $mh”.  However, the commands you show have a typo for the dispList of the KILL:

            set dipList “KILL $mh”      (rather than dispList)

            msgset $mh “A Message”

            set dispList “CONTINUE $mh”

            So, in this case, if the ‘return’ is using $dispList (not dipList), then the message will be CONTINUE’d

            Normally, you wouldn’t append a KILL and a CONTINUE to the disposition list for a message handle.

            Hope this helps.

            Jim Cobane

            Henry Ford Health

          • #60002
            garry r fisher
            Participant

              Hi,

              Matt – No if statement containing this block of tcl

              Jim – Sorry – the typo is mine, not the codes. It should say dispList.

              Any other thoughts? If not then I’m going to recommend that we rewrite it (if we can figure the exact logic).

              Regards

              Garry

            • #60003
              Greg Eriksen
              Participant

                Here’s what might be happening:

                1)  the dispList is “set” to kill the message handle.

                2)  msgset replaces the contents of the message handle, which is still there because the proc hasn’t returned yet so the handle hasn’t been killed yet.

                3)  the dispList is “set” again to a new value of continue, overwriting the previous kill value.

                If they had been building the dispList with lappend, this code wouldn’t work, but because they are using “set” it just means that the first one is superfluous.

              • #60004
                garry r fisher
                Participant

                  Well done Greg – Of course its set not lappend.

                  Thanks

                  Garry

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