OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: AvalanCh3 on 13 Dec 2004, 06:24:56
-
does anyone know how to escape a character for format?
is seems that i cannot print the % sign while using a format
hint format["%1"+"%",123]
-
in most other languages you can put "\" (backslash) in front of a charater so it displayed (dunno bout OFP)
or you can do something that i always do,
_percent = "%"
hint format ["%1%2",123,_percent]
-
Did that work?
What about using %% ?
-
why can't you do:
hint format["%1%",123]
maybe, or this:
hint format["%1","%2,123,%]
the problem is that % is a command in script
-
Yah, I'm pretty sure the only escape char in ofp is 'newline' (\n). I seem to remember trying to do this before, with no success...
You can always just put a space between the % and your numbers. Triggerhappy's second idea is interesting, even though it doesn't do what you want, and he messed up the quotes. :P
However, I don't know if you can use the + operator like how you are doing it, in the middle of a format command. Try this instead:
hint (format["%1",123] + "%")
Parenthesis may not be needed, but they help clarify the point. Format makes one string, and then you concatanate it with your other string "%" using the + operator.
-
format["100%1", "%"]
--Ben