列錶框忽略列表中的重複項!!大家好,下面是簡單的代碼,我使用列錶框打印兩個列表。在列表“Perf_cal”中,第2和第3項是相同的。因此,當我在jsl以下運行時,只有第2或第3項與其他項目一起打印。我需要的是打印列表中的所有項目(在這種情況下為8),而不刪除任何重複項。
謝謝
newwindow("new",
Perf_cal = {"101.6", "100.8", "100.8", "100.2", "101", "101.8", "100", "99.2"};
Perf_item = {"a", "b", "c", "d", "e", "f", "g", "h"};
perf=hlistbox(listbox(Perf_item,width(20),nlines(8)), listbox(Perf_cal,width(50),nlines(8)));
);Re:列錶框忽略列表中的重複項!!您可以做的另一種方法是通過在其前面加上perf_item來使perf_cal唯一。 當用戶進行選擇時,您需要去掉前三個字符。
Perf_cal = {"101.6", "100.8", "100.8", "100.2", "101", "101.8", "100", "99.2"};
Perf_item = {"a", "b", "c", "d", "e", "f", "g", "h"};
perf_list = {};
for (i = 1, i <= nitems(perf_cal), i++,
perf_list[i] = perf_item[i] || ". " || perf_cal[i];
);
New Window( "new",
perf = H List Box(
List Box( Perf_list, width( 50 ), nlines( 8 ) )
);
);Re:列錶框忽略列表中的重複項!!表格框和<< Set Selectable Rows消息允許您選擇單個項目。 根據您是否要一起選擇項目和cal,以下是構建窗口的兩種方法:

Names Default to Here( 1 );
Perf_cal = {"101.6", "100.8", "100.8", "100.2", "101", "101.8", "100", "99.2"};
Perf_item = {"a", "b", "c", "d", "e", "f", "g", "h"};
New window("new",
H List Box(
tb1 = Table box(
String Col Box( "Item", Perf_item ),
String Col Box( "Cal", Perf_cal )
),
spacerbox( size( 10, 10 ) ),
tb2 = Table box(
String Col Box( "Item", Perf_item )
),
tb3 = Table box(
String Col Box( "Cal", Perf_cal )
),
<<PADDING></PADDING>
Re:列錶框忽略列表中的重複項!!好吧,要使用字符串col框,錶框是沒有必要的。我沒有使用字符串col盒,bcoz,個別項目是不可選擇的。但是謝謝你看看它。Re:列錶框忽略列表中的重複項!!我不確定具體的列錶框問題,但我想知道一個表格框是否能實現你的目標。
Perf_cal = {"101.6", "100.8", "100.8", "100.2", "101", "101.8", "100", "99.2"};
Perf_item = {"a", "b", "c", "d", "e", "f", "g", "h"};
New window("new",
tb = Table box(
String Col Box( "Item", Perf_item ),
String Col Box( "Cal", Perf_cal )
)
);
tb << Set Selectable Rows( 1 );
tb << Get Selected Rows;