move to Cloverleaf 5.4.1 From Cloverleaf 5.2 TCL errors

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf move to Cloverleaf 5.4.1 From Cloverleaf 5.2 TCL errors

  • Creator
    Topic
  • #48964
    Pat Given
    Participant

      We compared the F-50 5.2 TCL proc to the Blade running cloverleaf 5.4.1.

      The TCLs are identical but on 5.4.1 we got the following TCL errors

      [xlt :xlat:ERR /0:   adt2_xlate:12/28/2006 08:06:37] Tcl error:

      msgId = message0

      proc = ‘tps_conv_a06_a08’

      args = ”

      result = ‘extra switch pattern with no body’

      errorInfo: ‘

      extra switch pattern with no body

         while executing

      “switch -exact — $mode {

             start {

      # Perform special init functions

      # N.B.: there may or may not be a MSGID key in args

      # Perform special init f…”

         (procedure “tps_conv_a06_a08” line 6)

         invoked from within

      “tps_conv_a06_a08 {MSGID message0} {CONTEXT xlt_raw} {ARGS {}} {MODE run} {VERSION 3.0}”‘

      [xlt :xlat:ERR /0:   adt2_xlate:12/28/2006 08:06:37] Tcl error:

      msgId = message0

      proc = ‘tps_conv_a06_a08’

      args = ”

      result = ‘extra switch pattern with no body’

      errorInfo: ‘

      extra switch pattern with no body

         while executing

      “switch -exact — $mode {

             start {

      # Perform special init functions

      # N.B.: there may or may not be a MSGID key in args

      # Perform special init f…”

         (procedure “tps_conv_a06_a08” line 6)

         invoked from within

      “tps_conv_a06_a08 {MSGID message0} {CONTEXT xlt_raw} {ARGS {}} {MODE run} {VERSION 3.0}”‘

    Viewing 2 reply threads
    • Author
      Replies
      • #60259
        James Cobane
        Participant

          Pat,

          With the implementation of 5.4.1, a newer version of tcl (8.4) is implemented; the 5.2 version of Cloverleaf uses tcl 8.3, I believe.  We ran across this issue, and found that the newer version of tcl didn’t like in-line comments on the line with the closing braces ‘}’ within ‘switch’ statements.  It was an easy fix; simply move the comment to a new line. I.e.

          switch -exact — $mode {

              start {

                         return “”

              }

              run {

                         keylget args MSGID mh

              }  ;# Does not like comments like this

          }

          Change to:

          switch -exact — $mode {

              start {

                         return “”

              }

              run {

                         keylget args MSGID mh

              }  

              # Likes comments like this

          }

          Also,  beware of older commands such as ‘translit’ that were deprecated in previous versions of tcl, but still worked; in 8.4, ‘translit’ definitely no longer work.

          Hope this helps.

          Jim Cobane

          Henry Ford Health

        • #60260
          Charlie Bursell
          Participant

            Remember the rule: comments can only appear where a command is expected.

            Within the body of a switch statement, commands aren’t expected. Only a list of patterns and bodies.

            This has always been the rule and seems to be better enforced in the newer version.  Not only did earlier versions of Cloverleaf run Tcl 8.3 but it ran Tcl 8.3.1!  That version of Tcl was up to 8.3.16 (I think) by the time Tcl 8.4 came out.  We are now at Tcl 8.4.12.  That is 1 major upgrade and about 28 minor upgrades in difference.

            I have *ALWAYS* taught in my Tcl classes that comments within switch statements can only go within the inner bodies.  Any comment outside of one of the bodies will cause an error!

          • #60261
            Pat Given
            Participant

              Thanks.

              The TCLs causing a problem are all full of the comments at the end of commands. i.e.    

              switch -exact — $segtype {

              MSH {

              set newseg “”

              #loop through and process fields

              set fields [split $seg $sep] ;# convert segment into field list

              I’ll change these as you suggested.

              The version of TCL running on our 5.2 allows this.

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