This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com

Home

 
4D v19.8
formula.call( )

formula.call( ) 


 

formula.call ( {thisObj {; params}{; params2 ; ... ; paramsN}} ) -> Function result 
Parameter Type   Description
thisObj  Object in Object to be returned by the This command in the formula
params  Mixed in Value(s) to be passed as $1...$n when formula is executed
Function result  in 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



See also 

formula.apply( )

 
PROPERTIES 

Product: 4D
Theme: Formulas

This command can be run in preemptive processes

 
PAGE CONTENTS 
 
HISTORY 

Created: 4D v17 R3

 
ARTICLE USAGE

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)