Maybe JMP is for some reason forced to perform re-evaluation if formula columns with custom functions are used.
Using JMP's example custom formula and Craige's example from https://community.jmp.com/t5/Discussions/Why-does-selecting-deselecting-rows-trigger-column-formulas... . Run the script, select one row, check lo, run rest of the script after stop, click row again.
Names Default To Here(1);
dt = New Table("Untitled",
add rows(3),
// EVERYTHINGCOL depends on everything. it evaluates last.
New Column("EVERYTHINGCOL", Formula(
Write("\!nEVERYTHINGCOL,row" || Char(Row()));
:ROWSTATECOL + :INDEPCOL + :DEPONINDEP;
)
),
// DEPONINDEP depends on INDEPCOL, but not ROWSTATECOL.
New Column("DEPONINDEP",
Formula(
Write("\!nDEPONINDEP,row" || Char(Row()));
:INDEPCOL + 1;
)
),
// INDEPCOL is independent. It evaluates early, maybe first.
New Column("INDEPCOL",
Formula(
Write("\!nINDEPCOL,row" || Char(Row()));
17;
)
),
// ROWSTATECOL is directly dependent on row state information. It evaluates early, maybe first.
New Column("ROWSTATECOL",
Formula(
Write("\!nROWSTATECOL,row" || Char(Row()));
Selected(Row State());
)
)
);
dt << Run Formulas;
Write("\!N -------------------- INITIAL PRINTS----------------\!N");
// Clear Log();
dt << select rows(1);
dt << Run Formulas;
Write("\!N -------------------- SEL ROW PRINTS 1----------------\!N");
funcDef = Function({x, y = 10}, x + y);
newAdd = New Custom Function("myNamespace", "Add Ten", funcDef);
newAdd << Formula Category("NumberStuff");
Add Custom Functions(newAdd);
new_col = dt << New Column("AddTen", Formula(
Write("\!nAddTen,row" || Char(Row()));
myNamespace:Add Ten(Row(), 1))
);
dt << select rows(2);
dt << Run Formulas;
Write("\!N -------------------- SEL ROW PRINTS 2----------------\!N");
// new_col << Suppress Eval(1);
You can also see this behavior if you just rerun << Run Formulas. If you don't have the custom formula there, nothing is printed (except for Scriptable[]) and if you add the formula using custom function, all the formulas will be rerun on each << Run Formulas (basically behaves like << rerun formulas, all formulas "must be" re-evaluated).
-Jarmo