Skip to content

7. Recursion

Nicolas BOITEUX edited this page Dec 27, 2017 · 10 revisions

Object methods can use the reference of their own object via the usage of the special variable MEMBER("this",nil)

It permits to transmit the object reference to an other object.

Example of method of objet A wich transmit it owns object reference to another B object through the setInstance function.

PRIVATE VARIABLE("code","this");

PUBLIC FUNCTION("code","transmitObject") {
	["setInstance", MEMBER("this",nil)] call _this;
};

/* deconstructor code to add */
DELETE_VARIABLE("this");

You have to explicitly declare and delete the variable. Initialisation is done automatically by OOP.

Clone this wiki locally