Array+=: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (aaaaaaa)
m (Text replacement - " it's" to " it is")
Line 2: Line 2:
The array[]+={} syntax for Arma 3 was introduced as an attempt to add unique weapons (or magazines) to a unit without the tedium of duplicate-typing all the basic items.
The array[]+={} syntax for Arma 3 was introduced as an attempt to add unique weapons (or magazines) to a unit without the tedium of duplicate-typing all the basic items.


It originally had a text-only interpreter making it quite impossible to generate config.bin's versus config.cpp's. Later, Binarize was modified to create new token code for this syntax. This token code is broken as it bears no relationship to any other tokenised output. It 'works' simply because it's data format can be ignored.
It originally had a text-only interpreter making it quite impossible to generate config.bin's versus config.cpp's. Later, Binarize was modified to create new token code for this syntax. This token code is broken as it bears no relationship to any other tokenised output. It 'works' simply because it is data format can be ignored.


It is not present in any form in any of the official addons accompanying Arma 3.
It is not present in any form in any of the official addons accompanying Arma 3.
<!-- //commented until somebody looks into this article
<!-- //commented until somebody looks into this article
As a command it is almost totally useless. Since nested hierarchy isn't permitted, it's pointless.
As a command it is almost totally useless. Since nested hierarchy isn't permitted, it is pointless.
-->
-->



Revision as of 17:13, 7 September 2020

Template:unbalanced The array[]+={} syntax for Arma 3 was introduced as an attempt to add unique weapons (or magazines) to a unit without the tedium of duplicate-typing all the basic items.

It originally had a text-only interpreter making it quite impossible to generate config.bin's versus config.cpp's. Later, Binarize was modified to create new token code for this syntax. This token code is broken as it bears no relationship to any other tokenised output. It 'works' simply because it is data format can be ignored.

It is not present in any form in any of the official addons accompanying Arma 3.


usage:

class A
{
  array[]={any,thing};
};
class B:A
{
  array+={more,Bstuff];
}
class C:A 
{
  array+={other, Cstuff};
};

ONLY direct inheritance works of an array explicitly stated in the inherited class as being array[]={some,thing}. The following WILL NOT WORK


class A {array[]={any,thing};}
class B:A{};
class C:B
{
 array[]+={wont,work}; // result: array[]={wont,work};
}

class A {array[]={any,thing};}
class B:A{array[]+={more,stuff};};
class C:B
{
 array[]+={wont,work}; // result: array[]={wont,work};
}