3 Replies Latest reply on Oct 30, 2006 5:59 AM by duckets

    remove quotation marks

    otterman
      Arrrragh!

      Ive done this before n cant remember how.
      When retreiving a line from a text doc it returns- "lineone'

      I wanna use this as a command, ie - lineone

      I put my question to you, how does one remove the " "
        • 1. Re: remove quotation marks
          Level 7
          str = QUOTE & "line 1" & QUOTE
          if str.char [str.length] = QUOTE then
          put empty into str.char [str.length]
          end if
          if str.char [1] = QUOTE then
          put empty into str.char [1]
          end if

          I added the conditional statements to insure the quotes are there and the
          code won't get rid of necessary characters
          --
          Craig Wollman
          Word of Mouth Productions

          phone 212 928 9581
          fax 212 928 9582
          159-00 Riverside Drive West #5H-70
          NY, NY 10032
          www.wordofmouthpros.com


          "otterman" <webforumsuser@macromedia.com> wrote in message
          news:eht1h7$ss8$1@forums.macromedia.com...
          > Arrrragh!
          >
          > Ive done this before n cant remember how.
          > When retreiving a line from a text doc it returns- "lineone'
          >
          > I wanna use this as a command, ie - lineone
          >
          > I put my question to you, how does one remove the " "
          >


          • 2. Re: remove quotation marks
            otterman Level 1
            OK here it is,- value

            example - sprite(5).member.model[1].shaderList[1] = value (member("import list").line[1])
            • 3. remove quotation marks
              duckets Level 1
              For future reference, here's a handler which you can use to substitute/remove any characters from any string. (put it in a moviescript).

              http://www.robotduck.com/content/articles/director/tools/string/sub.txt

              For your purpose, you would use it like this:

              newString = sub( originalString, QUOTE, "" )

              Which will replace all quotes with nothing (because of the empty string in the 3rd parameter).

              However - when setting an item in a model's shaderlist, you will need to set it to a value which is a reference to an actual shader in the scene (not just the name of a shader). So perhaps to make your code work, you might need something like this: (I have broken it apart into separate lines and variables, for clarity)

              scene = sprite(5).member
              myModel = scene.model[1]
              shaderName = member("import list").line[1]
              shaderName = sub(shaderName, QUOTE, "")
              shaderRef = scene.shader(shaderName)
              myModel.shaderList[1] = shaderRef

              hope this helps!

              - Ben