-
Notifications
You must be signed in to change notification settings - Fork 3
4. Variables Declaration
Nicolas BOITEUX edited this page Nov 4, 2017
·
15 revisions
To declare a variable you have to use a syntax like this:
_VISIBILITY_ VARIABLE("_TYPE_","_NAME_");
- PRIVATE Initializes a private member within a class. Private members may only be accessed by members of its own class.
- PROTECTED Initializes a protected member within a class. Protected members may only be accessed by members of its own class or child classes.
- PUBLIC Initializes a public member within a class. Public members may be accessed by anyone.
You have to choose your variable type according your need. Type should be a type equivalent of the return of typename command like:
-
ARRAY
-
STRING
-
SCALAR for numbers
-
CODE for other OOP object
-
OBJECT for arma object
The name of your variable.
It's particulary recommanded to initialize all your object variables during the construction of the object through the constructor method, and to reduce the visibility of them with PRIVATE visibility.