OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: ponq on 12 Jul 2004, 15:14:21

Title: How to get " in a string?
Post by: ponq 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.
Title: Re:How to get " in a string?
Post by: HerrFlick 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?
Title: Re:How to get " in a string?
Post by: ponq 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