みなさん、こんにちは、
データテーブルで作業しているのか、分析ウィンドウで作業しているのかを判断する方法があるかどうか疑問に思いました。データテーブルにいる場合はスクリプトが1つのことを実行し、分析ウィンドウにいる場合はスクリプトが別のことを実行するように、ifステートメントが必要です。
アイデアをありがとう!
スティーブ
どのウィンドウがアクティブであるかを確認できるはずですウィンドウタイトルを取得するそれをTry-structurewithで使用します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 />);