Quotation mark in argument

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Quotation mark in argument

  • Creator
    Topic
  • #54312
    Brandon Grudt
    Participant

      All,

      I have a global tcl script that checks a subfield and if the content of that message is in the list of arguments called OLDVALS, it will translate to the corresponding list of arguments called NEWVALS.  The argument looks like this:

      {SEGNAME GT1} {FIELDNUM 3} {SUBFIELDNUM 0} {OLDVALS {OLD1 OLD2 OLD3}} {NEWVALS {NEW1 NEW2 NEW3}}

      This works exactly how I need it.  The problem I have run into, is that I am trying to apply this script to an old value of “”.  I need to turn it to ND.  When I try this, I get a tcl error saying there is an unmatched open quote in list:

      {SEGNAME GT1} {FIELDNUM 3} {SUBFIELDNUM 0} {OLDVALS {“”}} {NEWVALS {ND}}

      When I try to escape it, it will simply not perform the translation:

      {SEGNAME GT1} {FIELDNUM 3} {SUBFIELDNUM 0} {OLDVALS {“”}} {NEWVALS {ND}}

      I’m relatively green, so hopefully there is something obvious I am omitting.  I can write a script to do this, but I make every attempt to not write a new tcl script if I do not have to do it.

    Viewing 2 reply threads
    • Author
      Replies
      • #80962
        Jim Kosloskey
        Participant

          Have you tried escaping the escape (\”)?

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #80963
          Charlie Bursell
          Participant

            I tried it and it seems you double quote get converted to a single quote.  An issue that should be reported to Support as an “undocumented enhancement” or bug  ðŸ˜€

            However, as Jim stated if you double quote it like:

            {OLDVALS {“”}

            It should work for you.

            This is a reason I am vey much against procs that receive multiple arguments to do multiple tasks.  In Tcl it is so easy and *MUCH* more maintainable to write a proc for a single task.

          • #80964
            David Coffey
            Participant

              The double quotes indicate no argument?  a null value?  

              Use a code to indicate the “” and convert the indicator code to the double quotes inside the proc.

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