This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
formula.call( )
|
formula.call ( {thisObj {; params}{; params2 ; ... ; paramsN}} ) -> Function result | ||||||||
Parameter | Type | Description | ||||||
thisObj | Object |
![]() |
Object to be returned by the This command in the formula | |||||
params | Mixed |
![]() |
Value(s) to be passed as $1...$n when formula is executed | |||||
Function result |
![]() |
Value from formula execution | ||||||
The formula.call( ) method executes the formula object to which it is applied and returns the resulting value. The formula object can be created using the Formula or Formula from string commands.
In the thisObj parameter, you can pass a reference to the object to be used as This within the formula.
You can also pass values to be used as $1...$n parameters in the formula using the optional params parameter(s).
Note that formula.call( ) is similar to formula.apply( ) except that parameters are passed directly.
$f:=Formula(Uppercase($1))
$result:=$f.call(Null;"hello") // returns "HELLO"
$o:=New object("value";50)
$f:=Formula(This.value*2)
$result:=$f.call($o) // returns 100
Product: 4D
Theme: Formulas
Created: 4D v17 R3
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)