As Global
As Global using For
Summary: Runs the creation and assignment of matrix variables from columns 4 and 5 in a specified data table, followed by interactive button box operations.
Code:
dt = Open("data_table.jmp");
DataM4 = "";
DataM5 = "";
SrcMatrix = "";
For( a = 4, a <= 5, a++,
SrcMatrix = "DataM" || Char( a );
As Global( SrcMatrix ) = Column( dt, a ) << get as matrix;
);
DataM4 = "";
DataM5 = "";
SrcMatrix = "";
New Window( "Test",
bb = Button Box( "Ok",
For( a = 4, a <= 5, a++,
SrcMatrix = "DataM" || Char( a );
As Global( SrcMatrix ) = Column( dt, a ) << get as matrix;
)
)
);
bb << click;
bb << close window();
Code Explanation:
- Open data table.
- Initialize empty strings.
- Loop through columns 4 and 5.
- Construct matrix variable name.
- Assign column data to global matrix.
- Clear matrix variables.
- Create new window.
- Add button box.
- On button click, loop through columns.
- Assign column data to global matrix.
- Click button programmatically.
- Close button window.