Using JMP 15.2.1.
I think I must have a misunderstanding of how variables work in JSL.I have run into this issue a few times, and would finally like to understand what I am doing wrong.
I have a function in which I do some calculations, store the results in variables, and then attempt to insert the results into a list. I know that the variables contain the values I want them to, but when I attempt to add them to the list it adds the variable name to the list instead of the value of the variable. Because these are locally defined variables, this then causes errors outside the scope of that function.
I have tried using Eval/Eval List anywhere I can think of but that is not working either.
How can I make the returned list contain the values within the variables.
Thanks in advance!
list = {{3,4}, {1,5}, {3,2}};
deltaX = 1;
deltaY = 2;
updateList = Function({cl, dx, dy},
{newX, newY},
newX = cl[1][1] + dx;
newY = cl[1][2] + dy;
show(newX);
Insert Into(cl, {{newX, newY}}, 1);
show(cl);
return(cl);
);
list2 = updateList(list, deltaX, deltaY);
show(list2);
//this errors because list2[1][1] contains newX instead of the value 4
//list2[1][1] + 1;