Hello - I'm trying to take a row from one table, and throw it into another table at a row the user specifies in an entry box. However, the update function doesn't seem to have the ability to specify rows, and so I'm left with taking an hour and typing out each of my 105 columns for both data tables as such:
dt:{"ColA"}[rownumber] = dt1:{"ColA"}[1];
dt:{"ColB"}[rownumber] = dt1:{"ColB"}[1];
.
.
.
dt:{"ColDA"}[rownumber] = dt1:{"ColDA"}[1];
Which is fine, but I can imagine my coding friends squirming in their seats at that. Is there a more elegant way to do this? I've seen someone reference associative arrays, but I'm having trouble using them.
I assume the code above suffices, but if it matters, here is the original code, with the relevant line being five lines from before the closing parentheses start, and commented appropriately:
w = New Window( "Choose Row Number for XRD Run input", // opens a window with a title and this content...
Border Box( top( 20 ), bottom( 20 ), Left( 20 ), Right( 20 ), // window dressing
V List Box( // V and H lists nest to organize the display boxes
H Center Box( Text Box( "Choose Row Number for XRD Run input" ) ), // a second title, centered
Spacer Box( size( 1, 30 ) ), // a little vertical space
H Center Box( rowtemp=Number Edit Box( ) ), // data entry
Spacer Box( size( 1, 10 ) ), // a little vertical space
H Center Box( // center the button
Button Box( "Import Data", // this script runs when the button is pressed...
rownumber = rowtemp << Get;
// Run XML Import
Include( "jmpprj://contents/Import XRD XML.jsl");
// Reference Data Tables
dt = Data Table( "Experimental Info" );
dt1 = Data Table( "XMLTempTable" );
// Move to Experimental info table
dt:{"xsi:Schema Location 1"}[rownumber] = dt1:{"xsi:Schema Location 1"}[1]; //THIS ONE
// Close XMLTempTable
close(dt1);
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);
Edward Hamer Chandler, Jr.