5 Replies Latest reply on Jul 25, 2008 9:53 PM by Newsgroup_User

    Quotation in a string

    EdwardST.
      In a string in lingo say word = "hello", i wanted word = "He said "hello" ", im not sure how to make it disregard the " " inside the string. In c++ you would use word = "He said \"hello\"" however in lingo this does not seem to work. Please help.

      Im using Director 8.5 btw
        • 1. Re: Quotation in a string
          Level 7
          EdwardST. wrote:
          > In a string in lingo say word = "hello", i wanted word = "He said
          > "hello" ", im not sure how to make it disregard the " " inside the
          > string. In c++ you would use word = "He said \"hello\"" however in
          > lingo this does not seem to work. Please help.

          word="He said " & quote & "hello" & quote & " "

          Andrew


          • 2. Re: Quotation in a string
            Devant Level 1
            put "He said:" && QUOTE &"Hello" & QUOTE &"."
            • 3. Re: Quotation in a string
              EdwardST. Level 1
              lol damn, ive got quite a lot of strings with quotes in them, this will take a while...

              Thanks, EdwardST
              • 4. Re: Quotation in a string
                Level 7
                Where are your strings? In an external text file or something? If you
                really have a lot, it might be worth trying to write a script able to
                automate the job.


                EdwardST. wrote:
                > lol damn, ive got quite a lot of strings with quotes in them, this will take a while...
                >
                > Thanks, EdwardST
                • 5. Re: Quotation in a string
                  Level 7
                  Here is an example of what I mean. It may not be exactly what you need,
                  but perhaps gives you ideas. It is a director movie I made that has just
                  a single field sprite on the stage. It is editable so you can type into
                  it. If you right click on a word, it will become surrounded by quotes.
                  If you right click on a quoted word, the quotes will be removed.

                  The useful part of it is, that it also copies a string into your
                  clipboard with the quotes converted in the manner that the other posters
                  suggested. In other word, you won't have to manually build the strings.

                  So the idea is that you run this little projector along with Director.
                  In the utility you type the string and add the quotes. Switch back over
                  to the Director script you are editing and paste in the string!

                  I really didn't do a whole lot of testing, so there may be some quirks.
                  Also it may not do everything you need, for example it won't enclose 2
                  adjacent words in the same pair of quotes. But you could always modify
                  the script to support that or other useful features.

                  Here is the utility already published as a projector.
                  http://www.mediafire.com/?gghim0ujt3u

                  Here is the source dir file
                  http://www.mediafire.com/?c1ejbxs5ddu

                  Let me know if it helps. Good luck.