String: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 10: Line 10:
'''Arma''' and '''Elite'''
'''Arma''' and '''Elite'''


Prior to Arma/Elite, strings were declared simply as a line of text up to end of line.
Since ArmA/Elite, strings can also be alternatively enclosed in apostrophes, like 'Hello'.
eg
TokenName=any strange thing you like;


the 'TokenName' was a 'known' keyword to the ofp engine. Model= eg. It could ''only'' be a string.
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.
 
Special cases existed such as
 
TokenName = ""a    very    finny line  with "Qoutes" ";


which essentially removed doubt for the compiler, where doubt might have existed.
Note: config strings use very similar syntax, but using quotes is optional.
 
Prior to Arma/Elite "Quotes" were largely optional.
 
Since ArmA/Elite, strings can also be alternatively enclosed in apostrophes, like 'Hello'. '''BUT''' strings <u>MUST</u> be enclosed Period.
 
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.


[[Category: Types]]
[[Category: Types]]

Revision as of 11:32, 30 June 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.

Compatibility notes:

Arma and Elite

Since ArmA/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.