您好 - 我正在尝试从一个表中取出一行,并将其放入另一个表中用户在输入框中指定的行中。 但是,更新函数似乎无法指定行,因此我需要花一个小时为两个数据表键入 105 列中的每一列,如下所示:
dt:{"ColA"}[rownumber] = dt1:{"ColA"}[1];<BR />dt:{"ColB"}[rownumber] = dt1:{"ColB"}[1];<BR />.<BR />.<BR />.<BR />dt:{"ColDA"}[rownumber] = dt1:{"ColDA"}[1];这很好,但我可以想象我的编码朋友们在座位上蠕动。 有没有更优雅的方法来做到这一点? 我见过有人引用关联数组,但我在使用它们时遇到了问题。
我认为上面的代码就足够了,但如果重要的话,这里是原始代码,相关行用红色绘制:
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
)
)
)
)
);