You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Nicolas BOITEUX edited this page Nov 28, 2017
·
2 revisions
Call a function from inside (MEMBER)
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.
Call a PUBLIC function from outside
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