How to pass " in arguments

Homepage Clovertech Forums Read Only Archives Cloverleaf Cloverleaf How to pass " in arguments

  • Creator
    Topic
  • #50059
    Rick Pritchett
    Participant

    Here is the proc I pass the arguments to.  It so far works except for quotes (“)

    Here is how i pass the arguments:

    {Remove_Character {&}} {Replace_Character {{}}}

    any ideas?

    proc tps_remove_Character { args } {

       keylget args MODE mode                  ;# Fetch mode

       set dispList {}             ;# Nothing to return

       switch -exact — $mode {

           start {

               # Perform special init functions

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

           }

           run {

               # ‘run’ mode always has a MSGID; fetch and process it

               keylget args MSGID mh

               keylget args ARGS.Remove_Character move_Character

     keylget args ARGS.Replace_Character place_Character

     set msg [msgget $mh]

               

               

               set msgHeader [string range $msg 0 7]

               set msgTail [string range $msg 8 end]

               set msgTail [string map “$move_Character $place_Character” $msgTail]

               append newmsg $msgHeader $msgTail        

               msgset $mh $newmsg

               lappend dispList “CONTINUE $mh”

           }

           time {

               # Timer-based processing

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

           }

           

           shutdown {

           # Doing some clean-up work

       }

       }

Viewing 4 reply threads
  • Author
    Replies
    • #64716
      Tom Rioux
      Participant

      Have you tried preceding your quotes with a backslash?

      example:  “”

      Tom Rioux

    • #64717
      Rick Pritchett
      Participant

      Here’s how i passed it and the error i got

      {Remove_Character {“”}} {Replace_Character {{}}}

      QDX_Tcl_SplitList(tps_remove_Character {Remove_Character {) failed — unmatched open brace in list

    • #64718
      Rick Pritchett
      Participant

      I think i figured it out instead of passing something like ” i used the hex value.

      EX.

    • #64719
      Tom Rioux
      Participant

      I was working on it yesterday and attempted to use the hex value for the quote.  I couldn’t get it to work and now realize that I entered the hex value incorrectly.  I’m glad you got it to work.

      I was reading somewhere that the braces ({}) and the quotes (“”) are part of the list command syntax.  If elements in a list are surrounded by quotes then the list command changes it to braces.  Maybe that is why the quotes would never work entered as is.

      Later…Tom Rioux

    • #64720
      Rick Pritchett
      Participant

      thanks for you help Tom

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

Forum Statistics

Registered Users
4,966
Forums
28
Topics
9,106
Replies
33,627
Topic Tags
248