我试图通过使用一致引用更新脚本来纠正我编写的脚本中以前的“罪过”,即,以便该脚本引用我(想要)告诉它的一个表,即使另一个表可能是当前的(或“干扰”)表。 我尝试重构下面的问题。
Names Default To Here( 1 );
// this is the table i want to work with
dt = New Table( "Target table", invisible,
Add Rows( 3 ),
New Column( "Name_1",
Character( 1 ),
"Nominal",
Set Values( {"A", "B", "C"} ),
Set Display Width( 45 )
),
New Column( "Name_2",
Character( 1 ),
"Nominal",
Set Values( {"X", "Y", "Z"} ),
Set Display Width( 45 )
),
New Column( "NumericRight",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [1, 2, 3] ),
Set Display Width( 78 )
),
New Column( "NumericAlso",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 8, 9] )
)
);
dt2 = New Table( "Interfering table", invisible,
Add Rows( 3 ),
New Column( "Name_1",
Character( 1 ),
"Nominal",
Set Values( {"D", "E", "F"} ),
Set Display Width( 45 )
),
New Column( "Name_2",
Character( 1 ),
"Nominal",
Set Values( {"U", "V", "W"} ),
Set Display Width( 45 )
),
New Column( "NumericInterference",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [4, 5, 6] )
),
New Column( "MoreNumeric",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [7, 8, 9] )
)
);
// get lists
lstName_1 = Associative Array( dt:Name_1 ) << Get Keys;
lstName_2 = Associative Array( dt:Name_2 ) << Get Keys;
colList = dt << Get Column Names( "Numeric" );
// window with radio buttons & col list box
New Window( "Select values",
Show Menu( 0 ),
Show Toolbars( 0 ),
Border Box( Top( 0 ), Bottom( 20 ), Left( 20 ), Right( 10 ),
H List Box(
Panel Box( "Name_1",
Radio Box(
Eval List( lstName_1 )
)
),
Panel Box( "Name_2",
Radio Box(
Eval List( lstName_2 )
)
),
Panel Box( "Numeric Columns",
clb = Col List Box( )
),
clb << Append( colList ); // making me cry ...
)
)
);
我想看什么:

如果我的“目标表”不是当前表,我总是会看到什么:

让我完全困惑的是,当我更改名称时dt2:数值干扰到dt2:数字右,我得到这个结果:

为什么 dt2 不让我的脚本完成我想要它做的工作? 为什么 dt2 中列的名称更改会影响列列表框中的内容? 我尝试了几种移动方法列列表变量并尝试将其包装到评估列表() ,没有“运气”。
再次在社区搜索,发现了这个需要有关填充列列表框的帮助。 如果有其他解决方案,谢谢您告诉我。 或者,这就是它本来的样子吗?如果是的话,这是什么意思?