call
This function calls a B4P function with the function name provided as a string. The 2nd function parameter may contain a set which will then be passed as function parameters to the targeted function. User-defined functions can be referenced here, but no flow-control functions and functions requiring code pieces in their parameters such as table process(), pick if(), etc.
Indirect parameter passing is disabled
Limited choice of function names, see above
Min. 1
No. | Type | Description |
---|---|---|
1 input |
string | Function name The name must refer to an existing B4P or user-defined function. |
2 input |
set | Function parameters The values in the set will be provided as function parameters to the target function |
Type | Description |
---|---|
all types | Return value It is the return value as provided by the specified target function |
define function( diag, { { value 1, numeral }, { value 2, numeral } } )
{
return( sqrt( value 1[] * value 1[] + value 2[] * value 2[] ) );
}
for all( { diag, sum, product }, function name[] )
{
echo( "Call ", function name[], "(3,4): ", call( function name[], { 3, 4 } ) );
}
Call diag(3,4): 5
Call sum(3,4): 7
Call product(3,4): 12