I have a function that I'm trying to run multiple times inside a loop for each unique value of a variable. Everything works great when I run it outside of the loop, and the loop runs fine when I run it without the function call. Have tried wrapping various parts of it in different Eval's, and while it didn't break anything it didn't help either.
The first iteration runs fine and the result of runBT is correct. If I run runBT("clstr2", 1); and runBT("clstr2", 2); outside of the loop it returns the correct results each time. If I comment out runBT inside the loop it shows i = 1 and then i = 2, iterating through both times as expected. Without it commented out it runs the function correctly once and then exits, "loop ended" is shown after the first iteration without any errors.
clust2vals = associative array(dt:clstr2) << get keys;
n = N Items (clust2vals);
show(n); //n = 2
show(clust2vals); // = 1
show(clust2vals); // = 2
for (i=1, i<=n, i++,
myab = runBT("clstr2", clust2vals);