-
Notifications
You must be signed in to change notification settings - Fork 3
6. Functions Call
MEMBER keyword works as a an internal accessor; MEMBER keyword checks the encapsulation standard: Is there an existing function with the right name, and parameter type according to the class declaration.
you can call a foo function waiting for a string as parameter, this way:
MEMBER("foo", "parameter");
The parameter type (string, array, scalar, any) transmit to MEMBER is very important cause several functions can be declare with the same name but differents type of parameters. Depending the type, MEMBER will call this function instead another with the same name.
You can call a function from outside when this function is declare as PUBLIC. You can use the reference variable of your object (return by constructor).
Example with the object foo and its function sayHelloWorld
_result = "sayHelloWorld" call _foo;
Example with the object foo and its function sayHelloWorld, and a string parameter
_result = ["sayHelloWorld", ""] call _foo;
Example with the object foo and its function sayHelloWorld, and an array parameter
_result = ["sayHelloWorld", []] call _foo;