You could try debugging the code in parts. You can "run" For Each Row with row by row by using Row() = rownumber instead of the loop.
//For Each Row(dtLookup,
Row() = 1;
col_name =:"Column Name"n;
If(contains(col_name_list,col_name),
old_properties = Column(dt, col_name) << get property("Axis");
old_with_new = Insert(old_properties,
{Expr( Add Ref Line(Expr(:P50), "Dashed", "Orange", "P50", 2),
Add Ref Line(Expr(:P95), "Dashed", "Orange", "P95", 2)
)
});
Eval(EvalExpr(Column(dt, col_name) << Set Property("Axis",{
Expr(old_with_new)
})));
);
);
And then start running code row by row:
old_properties = Column(dt, col_name) << get property("Axis");
//Empty()
Some break-points for debugging (I don't use Debugger, but it would most likely be even easier with it):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dtLookup = New Table("Lookup Table",
Add Rows(2),
New Column("Column Name", Character, Nominal, Set Values({"weight", "height"})),
New Column("P50", "Continuous", Set Values([100, 61])),
New Column("P95", "Continuous", Set Values([120, 70]))
);
col_name_list = dt << get column names(string);
col_name_list_lookup = dtLookup << get column names(string);
Column(dt, "weight") << Set Property("Axis", {Add Ref Line(10, "Dashed", "Red", "P10", 2)}); //debugging axis property
stop();
For Each Row(dtLookup,
stop();
Row() = 1;
col_name = Column(dtLookup, "Column Name")[Row()]; //easier to work with without For Each Row
If(contains(col_name_list,col_name),
old_properties = Column(dt, col_name) << get property("Axis");
stop();
new_properties = EvalExpr({Add Ref Line(Expr(:P50), "Dashed", "Orange", "P50", 2), Add Ref Line(Expr(:P95), "Dashed", "Orange", "P95", 2)});
stop();
If(!IsList(old_properties),
prop_to_add = Name Expr(new_properties),
prop_to_add = Insert(old_properties, new_properties);
);
show(prop_to_add);
stop();
Eval(EvalExpr(Column(dt, col_name) << Set Property("Axis",{Expr(prop_to_add)})));
);
);
Scripting Index for insert:
Some links to assist with scripting:
JSL Syntax Reference
Scripting Guide
JMP 16 Help
-Jarmo