thanks! this helps a lot
I have 1 last question:
using this code, I'm trying to create for each button a different value in the function.
so in this example if I click button 1 it should print 1, if I click 2 it should print 2 and so on..
but for some reason the value doesn't "stick" and any button I click it says 4.(4 is the number of i after the loop ends)
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(3),
Compress File When Saved(1),
New Column("a",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([1, 2, 3])
),
New Column("b",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([2, 2, 3])
),
New Column("c",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([2, 2, 3])
),
invisible
);
newFunc = function({i},
print(i);
);
dt << Select Where(:a > 1);
For(i = 1, i <= N Cols(dt), i++,
Column(dt, i) << Color Cells("Red");
);
dt << Clear Select;
dt << Select Where(:a == 1);
For(i = 1, i <= N Cols(dt), i++,
Column(dt, i) << Color Cells("Green");
);
dt << Clear Select;
rep = dt << get as report;
Close(dt, no save);
nw = New Window("Example",
hlb = h list box()
);
bblist = Expr(col box("Open Graph"));
For( i = 1, i <= 3, i++,
Insert Into(bblist, buttonbox("test"||char(i),newFunc(i)));
);
rep << append(bblist);
hlb << append(rep);
tb = (hlb << XPath("//TableBox"))[1];
tb << Set Scrollable(5,5);
is there a way to fix this?