Hola: estoy intentando tomar una fila de una tabla y colocarla en otra tabla en una fila que el usuario especifica en un cuadro de entrada. Sin embargo, la función de actualización no parece tener la capacidad de especificar filas, por lo que me queda tomarme una hora y escribir cada una de mis 105 columnas para ambas tablas de datos como tales:
dt:{"ColA"}[rownumber] = dt1:{"ColA"}[1];<BR />dt:{"ColB"}[rownumber] = dt1:{"ColB"}[1];<BR />.<BR />.<BR />.<BR />dt:{"ColDA"}[rownumber] = dt1:{"ColDA"}[1];Lo cual está bien, pero puedo imaginarme a mis amigos codificadores retorciéndose en sus asientos ante eso. ¿Existe una forma más elegante de hacer esto? He visto a alguien hacer referencia a matrices asociativas, pero tengo problemas para usarlas.
Supongo que el código anterior es suficiente, pero si es importante, aquí está el código original, con la línea correspondiente dibujada en rojo:
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
<FONT color="#FF0000">dt:{"xsi:Schema Location 1"}[rownumber] = dt1:{"xsi:Schema Location 1"}[1];</FONT>
// Close XMLTempTable
close(dt1);
// optionally, close the dialog. Or, you might want to run it again...
w << closeWindow; // just the dialog, not the report
)
)
)
)
);