String: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(nested strings)
m (no size limitations)
Line 8: Line 8:
If nested quotes are needed (quotes within quotes) they have to be doubled:<br>
If nested quotes are needed (quotes within quotes) they have to be doubled:<br>
<code>hint format["My name is ""%1""",name player]</code>
<code>hint format["My name is ""%1""",name player]</code>
Strings don't seem to have any limitation in size in Armed Assault.





Revision as of 01:23, 10 December 2006

Description: ASCII string, e.g. "My name is Victor Troska"

Strings are written enclosed in double quotes, like "Hello".

You can make a string out of any type by using format.

If nested quotes are needed (quotes within quotes) they have to be doubled:
hint format["My name is ""%1""",name player]

Strings don't seem to have any limitation in size in Armed Assault.


Compatibility Notes:

Armed Assault and Elite

Since Armed Assault/Elite, strings can also be alternatively enclosed in apostrophes, like 'Hello'.

Before ArmA, strings could be enclosed in curled braces, as there was no difference between strings and code.

In ArmA code needs to be distinguished clearly, strings can no longer use { } syntax.

Note: Config strings use very similar syntax, but using quotes is optional.