Home   Help Search Login Register  

Author Topic: How to get " in a string?  (Read 410 times)

0 Members and 1 Guest are viewing this topic.

ponq

  • Guest
How to get " in a string?
« on: 12 Jul 2004, 15:14:21 »
Does some1 know how to get the " in a string?

Why?

I want the have a text in a dialog which can be copied and pasted into a script.
eg.:
_dude = SwithcMove "Combat"

Now, the animation (Combat) changes, so I have:

_text = "_dude = SwitchMove " + _anim

How do I get " around the animation in the _text string?

Help appreciated, thnx.

HerrFlick

  • Guest
Re:How to get " in a string?
« Reply #1 on: 12 Jul 2004, 15:18:51 »
Yes, unbelievable crap this is, being used to Java/C like languages, I expected a escape character (like \, which they actually DID use in \n). Turns out it is done like this "", go figure.

So in your case that would make;

_text = "_dude = SwitchMove """ + _anim + """"; ??? (tested it and hey, it worked 8))

Count the "'s.... it really stinks...

BTW, couldn't you find this with the search?
« Last Edit: 12 Jul 2004, 15:19:45 by [ACAT] HerrFlick »

ponq

  • Guest
Re:How to get " in a string?
« Reply #2 on: 12 Jul 2004, 15:24:13 »
Thanks for the fast response!

And soz, couldn't find it in the search.




Btw, don't be bothered with the syntax error with switchmove in my example...;) :P
« Last Edit: 12 Jul 2004, 15:28:20 by ponq »