Dear JMPer,
I try to create several text boxes in a new window, the number of text boxes is a variable
Then I have a slider box , and I need to set text for those tex boxes I just created as I move the bar
I guess a for loop should be the solution, but I just cannot get it done
colname = {"Name", "Height", "Weight"}; //it's a list of column names from previous code, number of items is not fixed
min = 0;
max = 10;
Value = 0;
eval(evalexpr(
nw = New Window( "parameter setting",
Panel Box( "parameter setting",
tb1 = text box(char(colname[1]) || ": " || char(:expr(nameexpr(ascolumn(colname[1])))[1])),
tb2 = text box(char(colname[2]) || ": " || char(:expr(nameexpr(ascolumn(colname[2])))[1])),
tb3 = text box(char(colname[3]) || ": " || char(:expr(nameexpr(ascolumn(colname[3])))[1])),
//.
//.
//.
//.
//.
//.etc
//lines for tb should determined by N itmes(colname)
Valuetb = Text Box( "Value: " || Char( Value )),
sb = Slider Box(
min, max, Value,
Valuetb << set text( "Value: " || Char( Value ));
:Parameter A << set each value(Value);
tb1 << set text(char(colname[1]) || ": " || char(:expr(nameexpr(ascolumn(colname[1])))[1]));
tb2 << set text(char(colname[2]) || ": " || char(:expr(nameexpr(ascolumn(colname[2])))[1]));
tb3 << set text(char(colname[3]) || ": " || char(:expr(nameexpr(ascolumn(colname[3])))[1]))
) // when I move the slider box, values of all columns in colname will be changed, so I do set text for all columns in colname
)
)
))