문제
보고서를 표시하기 위해 표를 열었습니다. 테이블은 일시적이거나 보이지 않을 수 있으며 보고서를 닫으면 테이블이 자동으로 사라지기를 원합니다.
해결책
<< OnClose 메서드를 사용하여 스크립트에 보고서를 첨부하십시오. 스크립트를 테이블을 닫습니다.
// make a table
dt = New Table( "Temporary",
Add Rows( 1e6 ),
New Column( "x", Formula( Random Normal( 50, 30 ) ) ),
New Column( "y", Formula( Random Normal( 50, 30 ) ) ),
"Invisible"
);
// now make sure the formulas have finished evaluating
dt << RunFormulas;
// then clear the flag that says the table has changes that need to be saved
dt << SetDirty( 0 );
// finally, create a platform (or other window) with an OnClose script.
// the try() captures a message that might happen if the table is
// closed, causing the platform to close, causing the table to close...
dt << Bivariate( Y( :y ), X( :x ), <<ONCLOSE></ONCLOSE>
Platform with <<OnClose event attached<< OnClose 이벤트가 첨부 된 플랫폼