Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I have an issues with multiparameter functions in the input parameters of a variable. I dont manage to get a variable call like $(variable ( function(a,b) , c ) ) to work, but a call like $(variable ( function(a) , c ) ) works fine.
I have attached an exampel with the code and resulting error below. Seems to me as the function is not evaluated as a whole but the comma is interpreted a parameter seperator of the variable. Any suggestions?
Regards
//Nils
set pmf_poisson = pow($1,$2) / fact($2) * exp(-1*$1);
load
$(pmf_poisson(floor(2.5),2)) as test //working
,$(pmf_poisson(floor(2.5,0.25),2)) as test_2 //not working
autogenerate(1);
Results in the following script error:
Error in expression:
pow takes 2 parameters
load
pow(floor(2.5),2)/fact(2)*exp(-1*floor(2.5)) as test
,pow(floor(2.5,0.25))/fact(0.25))*exp(-1*floor(2.5) as test_2
autogenerate(1)
Hi,
Try to make a function in VBscript / JScript module . (Press CONTROL-M to see it.) For example:
function my_f(x, y)
my_f = x * y;
end function
You can call my_f(..) from script
-Alex
Thanks for the answer. I do have a solution that works in the script. The problem is I want to be able to able to use the expression in a graph and therefore I like to use a variable instead of a funcion.
It seems to me as the current behavior is inconsistent or bugged. Any second opinions on it?
Regards
//Nils