如何編寫列匹配對話框的腳本我有一個對話框,我需要一個用戶來匹配成對的列。 很像我們在 Join Tables 中所做的。

具體示例 - 我有一組實驗測量的參數和一組他們的理論預測。 這些數據來自不同的來源,列命名可以是任意的,所以我需要用戶為每個參數匹配理論與實驗。
有沒有關於如何編寫這部分腳本的示例? 以及如何保留這些對以及以後如何使用它們?
到目前為止,我有這個,我很感興趣如何在綠色框中編寫腳本以反映匹配的對(如上面的示例)以及如何保留這些對(2 個項目列表的列表?)以及如何刪除\召回他們等:

這是腳本:
dt = New Table( "Untitled 5",
Add Rows( 4 ),
Set Header Height( 46 ),
New Column( "X", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 2, 3, 4] ) ),
New Column( "A_Theory", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 3, 2, 3] ) ),
New Column( "B_Measured", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 5, 6, 5] ) ),
New Column( "A_Measured", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [1, 4, 3, 4] ) ),
New Column( "B_Theory", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [4, 5, 3, 4] ) )
);
notImplemented = Expr(
win = New Window( "Feature Not Implemented Yet", <<MODAL></MODAL>
腳本回复:如何編寫列匹配對話框的腳本如果我不得不猜測,加入平台使用列錶框,當您添加列對時,它會在其中附加新值。
Names Default To Here(1);
dt = New Table("Untitled 5",
Add Rows(4),
Set Header Height(46),
New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 4])),
New Column("A_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([1, 3, 2, 3])),
New Column("B_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 6, 5])),
New Column("A_Measured", Numeric, "Continuous", Format("Best", 12), Set Values([1, 4, 3, 4])),
New Column("B_Theory", Numeric, "Continuous", Format("Best", 12), Set Values([4, 5, 3, 4]))
);
notImplemented = Expr(
a = clb1 << get selected;
b = clb2 << get selected;
lb << Append(a[1] || "=" || b[1]);
);
gui = Expr(
H List Box(
V List Box(
Panel Box("Theory",
clb1 = Col List Box(All, Nlines(5))
),
Panel Box("Experiment",
clb2 = Col List Box(All, Nlines(5))
)
),
Panel Box("Theory vs Experiment Matching",
H List Box(
Button Box("Match", notImplemented),
lb = List Box({}, Nlines(12))
)
)
)
);
fileLoad = New Window("Example", Show Menu(0), Show Toolbars(0), gui);
//{col1, col2} = Words((lb << get items)[1], "=");

我只是快速地將腳本拼湊在一起,因此使用比變量更好的命名,防止在 col 列錶框中選擇多個值並刪除列索引的硬編碼限制。 當您需要值時,您可以使用 << 獲取列錶框引用的項目,這將為您提供項目列表。 然後使用 Words() 將其進一步拆分為不同的部分。