2.32 :recall()
This method can call any predefined and user-defined methods. This is necessary, for example, if the method to be called is calculated itself or stored in a variable.
Calling the :recall() method indirectly invokes the specified method and returns the return value of the invoked method. The number of parameters that can be passed when using :recall() is limited to 15. This is important when designing own methods.
Definition
anyvalue :recall
(
method Method input
{ , anyvalue Par1 input }
...
{ , anyvalue Par15 input }
)
Parameters
- method Method input
- The method to be invoked is passed in this parameter.
- anyvalue Par1 input
…
anyvalue Par15 input - The parameters of the method to be caled are passed in these parameters. The specified parameters must correspond in number and data types to the parameters of the method to be called.
Return value
Return value of the method to be called.
Forcing the Recursive Call of Other Methods
The :recall() method can be used to force a recursive call of other methods, e.g. of :get() and :set(). This distinguishes it from the :call() method.
Example
dialog RECALL
record Rec
{
integer Progress := 0;
integer Max := 100;
:set() {
case (Attribute)
in .Progress:
if Value < 0 then
Value := 0;
else
if Value > this.Max then
Value := this.Max;
endif
endif
this:super();
in .Max:
this:super();
if this.Max<this.Progress then
// The consistency check for .Progress should be carried out
// again. For this purpose :set() is called recursively.
this:recall(:set, .Progress, this.Max, false);
endif
endcase
}
}
on dialog start
{
Rec.Progress := 90; // Target .Progress = 90.
Rec.Max := 50; // .Progress must also be adjusted .
// Target .Progress = 50, .Max = 50.
}
See also
Method :call()