안녕하세요 여러분,
데이터 테이블에서 작업 중인지 분석 창에서 작업 중인지 알 수있는 방법이 있는지 궁금합니다.데이터 테이블에있는 경우 스크립트가 한 가지 작업을 수행하고 분석 창에있는 경우 스크립트가 다른 작업을 수행하도록 if 문을 갖고 싶습니다.
아이디어에 감사드립니다!
스티브
어떤 창이 활성화되어 있는지 확인할 수 있어야합니다. 창 제목 가져 오기 Try-structure와 함께 사용하십시오. Datatable (참조) << 이름 가져 오기 (또는 N 행 (데이터 테이블 (참조) 예를 들면.
예:
Names Default To Here(1);<BR />Open("$SAMPLE_DATA/Consumer Preferences.jmp");<BR />wait(2);<BR />curWindow = current window() << Get Window Title; //get window title to curWindow variable<BR />//use Try to check if curWindow is datatable with << Get name or N Rows<BR />Try(<BR />//Show(N Rows(Datatable(curWindow))),<BR />Write(Datatable(curWindow) << Get Name || " --- this is datatable\!N"), //datatable<BR />Write(curWindow || " --- this is not datatable\!N"); //not datatable<BR />);<BR />wait(1);<BR />//create "analysis" which should became active<BR />nw = New Window("Consumer Preferences",<BR />Graph Builder(<BR />Size(495, 450),<BR />Show Control Panel(0),<BR />Variables(X(:Single Status)),<BR />Elements(Points(X, Legend(2)))<BR />);<BR />);<BR />wait(1);<BR />//repeat test used earlier<BR />curWindow = current window() << Get Window Title;<BR />Try(<BR />Write(Datatable(curWindow) << Get Name || " --- this is datatable"), //datatable<BR />Write(curWindow || " --- this is not datatable"); //not datatable<BR />);