概述
以下範例示範如何選擇資料表中包含 JSL 清單中儲存的任何值的行。可以使用包含數字或字串的清單。
指示
在 JMP® 會話中,按一下檔案選單並選擇新建 ► 腳本。複製以下腳本並將其貼上到腳本視窗中。若要執行範例腳本,請按一下「編輯」功能表並選擇「執行腳本」 。
/* Open a sample data table. */
dt = Open( "$SAMPLE_DATA\Big Class.jmp" );
/* Create a list of ages. */
myList = {9, 12, 15, 17, 18};
/* Select all rows which have an age that is in the list. */
dt << Select Where( Contains( myList, :age ) );
Wait( 2 ); // For demonstration purposes
dt << Clear Select; // For demonstration purposes
/* Create a list of student names. */
myStudents = {"HENRY", "ROBERT", "BARBARA", "SALLY", "MARION"};
/* Select all rows which have any of the names in the list. */
dt << Select Where( Contains( myStudents, :name ) );
附加文檔
有關 JMP 腳本語言的更多信息,請參閱JMP 腳本編寫指南。您可以透過點擊 JMP 中的幫助選單並選擇JMP 幫助。從線上目錄中,選擇腳本指南.
[以前的 JMP 註 49560]
@Wendy_Murphrey ,您能否透過在哪裡()發布一個新方法的相應範例