Skip to content

3. Functions declaration

Nicolas BOITEUX edited this page Nov 28, 2017 · 4 revisions

To declare a function you have to use a syntax like this:

_VISIBILITY_ FUNCTION("_TYPE_","_NAME_") {
	{your code foo};
};

_VISIBILITY_

  • 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.

_TYPE_

Be care of this, TYPE declare the parameter input type for the function call (not the output type). If you dont respect the type in your call, the function will be silently ignore.

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

  • ANY accept all types of parameters

  • "" - no parameters is required

_NAME_

The name of your function. Currently the function name check, is not case sensitive. So the call to "foo" method, and "Foo" method have the same effect.

Clone this wiki locally