안녕하세요 - 한 테이블에서 행을 가져와서 사용자가 입력 상자에 지정한 행에 있는 다른 테이블에 던지려고 합니다. 그러나 업데이트 함수에는 행을 지정하는 기능이 없는 것 같습니다. 따라서 두 데이터 테이블 모두에 대해 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
)
)
)
)
);