Data Types: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "{{task/}}" to "{{Checkbox|yes}}") |
Lou Montana (talk | contribs) m (Text replacement - "{{task}}" to "{{Checkbox|no}}") |
||
Line 39: | Line 39: | ||
| [[String]] || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | | [[String]] || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- <!-- ArmA --> | |- <!-- ArmA --> | ||
| [[Code]] || {{ | | [[Code]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Config]] || {{ | | [[Config]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Control]] || {{ | | [[Control]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Display]] || {{ | | [[Display]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Location]] || {{ | | [[Location]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Script (Handle)]] || {{ | | [[Script (Handle)]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Structured Text]] || {{ | | [[Structured Text]] || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- <!-- Arma 2 --> | |- <!-- Arma 2 --> | ||
| [[Diary Record]] || {{ | | [[Diary Record]] || {{Checkbox|no}} || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Task]] || {{ | | [[Task]] || {{Checkbox|no}} || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Team Member]] || {{ | | [[Team Member]] || {{Checkbox|no}} || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|- | |- | ||
| [[Namespace]] || {{ | | [[Namespace]] || {{Checkbox|no}} || {{Checkbox|no}} || {{Checkbox|yes}} || {{Checkbox|yes}} | ||
|} | |} | ||
Revision as of 06:27, 26 December 2020
Template:SideTOC The data type of a variable specifies which data it may contain. Certain operators and scripting commands require variables to be of certain types.
Definition
The data type of a variable depends on the value given to it on initialization.
myVar = ""; // myVar is now a String
a local variable should be prefixed with private (Arma 3) or local (Arma 2) to avoid a potential upper-scope variable overwrite:
private _myLocalVariable = ""; // Arma 3 local _myLocalVariable = ""; // Arma 2
Redefinition
The data type of a variable may be changed at any point of the game by just redefining the variable with another type.
myVar = ""; // myVar is a String myVar = 0; // myVar is now a Number
Available Types
Magic Types
There are some magic data types, which are not really datatypes, as they do not describe any particular value.
Syntactical Helper Types
Some more types are used to provide for a construction of syntactically richer constructs than normal unary / binary operators.