OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: Ext3rmin4tor on 10 Jan 2009, 12:52:44
-
Are all the variables used and defined in the game (of any kind, global or local) pointers? I'm interested in this because I need to know if this code
_array1 = [1, 5, 7, 4];
_array2 = _array1;
_array1 = _array1 - [5];
produces as result
array1 = [1, 7, 4]
array2 = [1, 7, 4]
or
array1 = [1, 7, 4]
array2 = [1, 5, 7, 4]
that is, if array2 is a copy of array1 or it is a pointer to the same object of array1.
-
should be in here:
http://community.bistudio.com/wiki/Array
-
Or even right here at OFPEC: Array (http://www.ofpec.com/COMREF/index.php?action=read&id=70#Array).
Essentially, array1 and array2 are two variable names that point to the same data (array).
If you change one you change them both.
Planck
-
Ok thans, that's what I wanted to know.