I am inserting two Boxes into an H List Box. The First is a report from a table. That table can have a varying number of rows depending on what happens previously in script, but always has the same number of columns. The second box I am inserting, is a V List Box. For Each row of the table, I want a button box added to the V List, and for it to be able to reference the respective rows data. ie. Button Box 1 references the value in Row 1, Column 3, in the table in the H List Box. My problem is I cant seem to reference that value, when I am using a "for loop" to create the number of Button boxes equal to the number of rows in the table. I know it is trying to reference the cell with the row = i at the end of the for loop, I just dont know how to get it to "save the value of i" for each button box. My Current Code is shown below:
OutputTable = Current Data Table();
HList = H List Box( OutputTable << Get as Report() );
//Show(Column(OutputTable, 3)[1]);
SavingVlb = V List Box( Text Box( "Save to External Table" ) );
For( i = 1, i < N Rows( OutputTable ) + 1, i++,
BB = Button Box( "Save",
<<setFunction(
Function( {i},
Print( Column( OutputTable, 3 )[i] );
)
)
);
Insert Into( SavingVlb, BB );
);
Insert Into( HList, SavingVlb );
New Window( "test", HList );
Any help would be greatly appreciated.