2.4 :call()
The method :call() is used to invoke any built-in method or user-defined method. This is necessary if the method to be invoked is calculated or saved in a variable. Calling :call() indirectly results in the call of the given method. The return value corresponds to the indirectly called method. When invoked via :call(), however, only a maximum of 15 parameters can be passed to the indirectly called method. Please note this when you design methods. The method :call() can also call built-in methods such as :insert() or :delete().
Definition
anyvalue :call
(
method Method input
{ ,anyvalue Arg1 input }
...
{ ,anyvalue Arg15 input }
)
Parameters
- method Method input
- This parameter contains the method to be called.
- anyvalue Par1 input
…
anyvalue Par15 input - In these optional parameters the parameters of the method to be called are specified. The number of specified parameters must correspond to the number of parameters of the method to be called.
Return value
Return value of method being invoked.
Objects with this method
All objects which can have user-defined methods or have built-in methods.
Example
dialog Example
record Rec
{
string String;
rule void SomeMethod() { }
rule boolean Display(object Obj input) { }
}
on dialog start
{
Rec:call(:SomeMethod); // calls the method SomeMethod
Rec:call(:Display, this); // calls the method Display
// with the dialog being the object
}
See also
Method :recall()