This does work for me
Names Default To Here(1);
// Open a data table or replace "Data Table Name" with the name of your data table
dt = Current Data Table();
// Get the all column names from the data table
columnNames = dt << Get Column Names("String");
// Choose the specific column
cl = New Window("Column Selection",
<<Modal,
H List Box(
Panel Box("Make a selection",
V List Box(allcolumn = Radio Box(columnNames, prmtr = allcolumn << get))
)
)
);
//Text Box Put value spec limit Upper & Lower
wd = New Window("Spec Limit",
<<modal(),
H List Box(Text Box("HighL:"), High_Limit = Number Edit Box("", <<set width(10)), ),
Button Box("OK", HighL = High_Limit << get)
);
// If cancel or X was clicked, stop the script
If(wd == {Button(-1)}, Stop());
wd = New Window("Spec Limit",
<<modal(),
H List Box(Text Box("LowL:"), Low_Limit = Number Edit Box("", <<set width(10)), ),
Button Box("OK", LowL = Low_Limit << get)
);
// If cancel or X was clicked, stop the script
If(wd == {Button(-1)}, Stop());
//Put value Spec Limit on choosen column
col = Column(prmtr);
Eval(EvalExpr(
col << Add Column Properties(
Set Property(
"Spec Limits",
{LSL(Expr(LowL)), USL(Expr(HighL)), Show Limits(2)}
)
)
));
Also if you would like to, you could combine all those selections into a single modal window
Names Default To Here(1);
dt = Current Data Table();
col_names = dt << Get Column Names("String", Continuous);
nw = New Window("Set Specs", << Modal,
H List Box(
Panel Box("Select Column",
rb_col = Radio Box(col_names)
),
Panel Box("Select Limits",
Lineup Box(N Col(2),
Text Box("LSL: "),
lsl_neb = Number Edit Box("", <<set width(10)),
Text Box("USL: "),
usl_neb = Number Edit Box("", <<set width(10))
)
),
Panel Box("Actions",
Lineup Box(N Col(1),
Button Box("OK",
lsl_val = lsl_neb << get;
usl_val = usl_neb << get;
sel_col = rb_col << get selected;
),
Button Box("Cancel")
)
)
)
);
If(nw["Button"] != 1,
Throw("Cancel pressed");
);
show(sel_col, lsl_val, usl_val);
-Jarmo