Using a script, I need to construct a completely self-contained journal file with button boxes that reproduce data tables. In the production application, there will be many headings (each representing a part), and each heading will have several button boxes beneath it, each showing a different data table associated with the part. Because of the complex calculations that go into constructing the data tables, I am constructing them using functions. My intent would be to distribute ONLY the journal file to users.
I have constructed a skeletal example using the Baltic.jmp sample data table. The function "SmallTables()" returns the table script as text. But I can't find a way to enter that text in the script boxes for the button boxes in the journal file. Any help would be greatly appreciated.
SmallTables = Function( {k},
dt = Open( "$Sample_Data/Baltic.jmp" );
dt_Small = dt << Subset( Rows(), Columns( Column( k ) ), Output Table Name( "Small" ) );
Close( dt, NoSave );
tblScript = dt_Small << Get Script;
result = Char( Name Expr( tblScript ) );
);
jrn = New Window( "Table Test", Outline Box( "Title" ) );
For( k = 1, k <= 5, k++,
jrn << Append( BB = Button Box( "Small Table " || Char( k ), Set Script( SmallTables( k ) ) ) )
);