Skip to content

6. Functions Call

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

_result = ["sayHelloWorld", []] call _foo;

Clone this wiki locally