class Function

Instances of this class are used to inspect Ferite functions

class contents [NB. Highlighted attributes are static members]
Functions
function constructor(void,string) - The constructor of the "Function" class
function exec() - Calls the function associated with this object
function execWithArray(array) - Calls the function associated with this object
function getParameterDetails() - Generates an array of the parameters the function expects

Functions

function constructor Click to go up to the list
The constructor of the "Function" class
Declaration:
    function constructor( void o, string f )
Description:
The constructor of the "Function" class can either be called with the absolute name of a function (eg. "Console.println") or with an object and the name of a method within the object (eg. Console.stdout, "printf"). The specified function will be associated with the newly created "Function" object.
Parameters:
    Parameter #1: void o - The container the function is a member of (optional)
    Parameter #2: string f - The name of the function
Example:

class TestClass {
    function g( string name ) {
    }
}

function f( string name ) {
}

object t = new TestClass();
object o = new Function('f');
object p = new Function(t, 'g');


function exec Click to go up to the list
Calls the function associated with this object
Declaration:
    function exec( ... )
Description:
This function calls the function associated with this "Function" object using the specified arguments. The value which the function returned is returned unchanged. If you want to pass the arguments as an array instead of as a variable argument list, see Function.execWithArray().
Returns:
    The value which the called function returned
Example:

function f( string name ) {
}
object o = new Function('f');
o.exec( "Hi There" );


function execWithArray Click to go up to the list
Calls the function associated with this object
Declaration:
    function execWithArray( array params )
Description:
This function calls the function associated with this "Function" object using the values in the specified array as the function arguments. The value which the function returned is returned unchanged. If you want to pass the arguments directly instead of as an array, see Function.exec().
Parameters:
    Parameter #1: array params - The arguments to pass to the function
Returns:
    The value which the called function returned
Example:

function f( string name ) {
}
object o = new Function('f');
o.execWithArray( [ "Hi There" ] );


function getParameterDetails Click to go up to the list
Generates an array of the parameters the function expects
Declaration:
    function getParameterDetails( )
Description:
This function generates an array of the parameters which the function associated with this Function object requires. The key strings are the names of the arguments and the values are the names of the arguments types as strings. Note that this function does not work well in conjunction with argument overloading. The returned argument array will describe the arguments of the first function the compiler encountered with a particular name, but there could be other functions with the same name but different arguments.
Returns:
    An array of the parameters required by the function
Example:

function f( string name ) {
}
object o = new Function('f');
array params = o.getParameterDetails*); » params = [ 'name' => 'string' ]


Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.