Core Function Call
From Sputnik Wiki
Call(<function/array>, <expressions>)
Contents |
Description
Calls a function contained in a string parameter.
function
The name of the user function to call.
OR
A two element array to use as the call class and function name.
expressions
None, One or more arguments to send to the function.
Return Value
Acts like a regular function call.
Remarks
The function CAN be a built-in Sputnik function or a user defined one.
The function can pass arguments to functions, also & pointer parameters are supported.
Warning: The function NAME is taken as a string is only ever parsed ONCE so make sure you send a string that you know is not going to be changing such a literal string "myfunc"
Example
Call( "Test", 10, 20); Function Test($a, $b) { println("Hello from test ($a, $b)"); }
Example of using the first param as an array to call stuff within classes etc
Class Testy { Function __Construct() { Call( array($this, "Test"), 10, 20); } Function Test($a, $b) { println("Hello from test ($a, $b)"); } }; my $newTesty = new Testy();