如何编写列匹配对话框的脚本我有一个对话框,我需要一个用户来匹配列对。 很像我们在 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() 将其进一步拆分为不同的部分。