列選択の問題開いているすべてのファイル名をリストボックスに格納するビジュアライゼーションを作成しています。特定のファイルを選択し、そのファイルのすべての数値列をcolListBoxに表示したいのですが、不思議なことに、これは自分で作成したファイルにしか機能せず、サンプルディレクトリにある他の2つのファイルには機能しません。選択したテーブルを「現在のデータテーブル」に設定しようとしましたが、テーブルを切り替えたときに列を切り替える方法がわかりません。
現時点では、defects.jmp テーブルの列はロードされますが、他の列はロードされません。
ns = newNameSpace();
// Get some Data
dt1 = Open( "$SAMPLE_DATA/Big Class.jmp" ); // JMP Library.
dt1 = Open( "$SAMPLE_DATA/Football.jmp" ); // JMP Library.
dt1 = Open( "defects.jmp" ); // Troy Local File.
// Get a list of open files
openDTs = {};
for(i=1, i<= nTable(), i++,
insertInto(openDTs, dataTable(i))
);
// Create File and Column Selector
selectionWindow = newWindow("Col Selection Test",
ns:tableBox = listBox("", << setwidth(200), << setNLines(5), maxSelected(1),
selectedTable = (ns:tableBox << getSelected)[1];
currentDatatable(dataTable(selectedTable));
colList = dataTable(selectedTable) << getColumnNames("Numeric");
show(colList);
ns:columnBox << setItems(colList);
);
ns:tableBox << setItems(openDTs);
ns:columnBox = colListBox({}, width(177), << setNLines(5), maxSelected(1));
hListBox(ns:tableBox, ns:columnBox);
);
「欠陥」を選択すると、次のような結果が表示されます。これが望ましい結果です。

ただし、他のテーブルを続けて選択しても、列にはデータが入力されません。

欠陥.jmp テーブル

さまざまなオプションを試しましたが、何も機能しないようです???奇妙です。
何か提案はありますか?
自動化とスクリプト列選択の問題特定のデータテーブルを参照するため、Col List Boxを置き換える必要があります。
Names Default To Here(1);
ns = New Namespace();
Open("$SAMPLE_DATA/Big Class.jmp");
Open("$SAMPLE_DATA/Football.jmp");
Open("$SAMPLE_DATA/Cars.jmp");
dts = Get Data Table List() << get name;
selectionWindow = New Window("Col Selection Test",
H List Box(
lb = List Box(
dts,
<< Set Width(200),
<< Set NLines(5),
maxSelected(1),
sel_vals = lb << Get Selected;
If(N Items(sel_vals) > 0,
(clb_collector << Child) << Delete Box();
clb_collector << Append(
clb = Col List Box(Datatable(sel_vals[1]),
<< Set Items(Data Table(sel_vals[1]) << Get Column Names("Numeric", "String")),
<< Set Data Type("Numeric"),
width(177),
<
<SETNLINES></SETNLINES>
列選択の問題素晴らしいです。ありがとう、Jarmo。
削除して再度追加する。なぜ気づかなかったのだろう。
また、非常に便利な関数「Get Data Table List()」があることを知りませんでした。:)
早速のお返事ありがとうございます。