Hi,
I'm trying to create an automated addition of button boxes that will script point to individual Outline Boxes (as an example with Scroll Window or close) - I manage to get the expression built through a For loop that inserts the name of the script items in the list successfully, but when I go to have the button boxes each have a unique script, they instead hold the name of the expression 'buttonclickexpr' as the script.
How do I get the script in the expression evaluated and placed correctly as a written command that the button box will run on click?
//an example of how the window could appear
report_win=new window("test", content_VLB=V List Box(), Outline Box("Example: Distribution"), Outline Box("Example: Multivariate"));
//example of the variable that would store the name of scripts that created the OBs
script_new={"Distribution", "Multivariate", "Profiler"};
//the for loop to correctly setup the expression with the correct section name and add a button
For( i = 1, i <= N Items( script_new ), i++,
buttonclickexpr = Expr(
report_win << Scroll Window(
report_win[Outline Box( sectionName)]
)
);
Substitute Into( buttonclickexpr, Expr(sectionName), Char("Example: " ||script_new[i]) );
write(buttonclickexpr);
// Add a button to the list
content_VLB<<append(
Button Box( "Go to " || script_new[i], buttonclickexpr )
);
);