私はここで何か間違ったことをしていますか、それともこれはバグですか?以下のコードをJMP14または15のいずれかで一度に1つのコマンドで実行すると、最後に3つのテーブルが開きます。すべてを一度に実行すると、1つのテーブルがGUIで開かないか、自動的に閉じます。これは、最後の行のエラーによって証明されます。
// This script should open 2 tables and create a third based on the first two.
// Run script line by line and all three are open at the end. Run all at once
// and the first table, dtDD, is not open when the script is finished.
names default to here(1);
dtDD = Open("$Sample_Data/Big Class.jmp");
dtDDOld = Open("$Sample_Data/Big Class Families.jmp");
if(left(jmpversion(),2) == "15",
dtDDOld << Delete Row( 1 ); //not sure why this didn't delete a row in JMP 14...
,
dtDDOld << select where( row() == 1 );
dtDDOld << delete rows();
);
//find new tags
dtDDNew = New SQL Query(
Version( 130 ),
Connection( "JMP" ),
QueryName( "New Query" ),
Select(
Column( "name", "t1" ),
Column( "age", "t1" ),
Column( "sex", "t1" ),
Column( "name", "t2", Alias( "name 2" ) )
),
From(
Table( dtDD << Get Name, Alias( "t1" ) ),
Table(
dtDDOld << Get Name,
Alias( "t2" ),
Join(
Type( Left Outer ),
EQ( Column( "name", "t1" ), Column( "name", "t2" ) )
)
)
),
Where(
Custom(
"t2.\!"name\!" is null and (t1.\!"name\!" is not null)",
UI( Custom( Base( "Continuous" ) ) )
)
)
) << Run;
dtDD << bring window to front;
これまでのところ、最初のステートメントが完了する前に将来のステートメントを実行しようとしたときにのみ、この問題に遭遇しました。この場合、最初のステートメントは実際にはまったく完了しません(データがロードされ、その変数を介して利用可能にならないだけです)。または、スクリプトの一部ではないテーブルが後で閉じられます。ただし、待機を追加すると修正されます。 JMPサポートがどう思うか見ていきます。
ありがとうございました
JMPインタープリターは、JSLステートメントを次々に処理し、後続のステートメントが処理される前に、コードの上記のステップが完了するのを必ずしも待機する必要はありません。 つまり、JSLが処理を続行するときに、一部のステートメントがバックグラウンドで実行されます。これが起こっていることだと思います。 JSLを強制的に待機させる方法はいくつかあります。を使って
Wait(0);
また
dtDD<<数式を再実行します。
処理前にJSLを強制的に一時停止します。
ビッグクラスとビッグクラスファミリーのOpen()関数の後で、またその直前にWait(0)を配置しました。
dtDD<<ウィンドウを前面に表示します。
その結果、JSLが適切に実行されました。