LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI8-"LIST"-orders its items in what an order ?

hallo,

using the "List" comming with CVI8 I have some trouble. the list makes its own "sorting", but I wanted to have the order just like i put the items into the list. any idea ?

best regards

Simon
0 Kudos
Message 1 of 6
(3,444 Views)

Hello Simon,

are you talking about the List Box control, or about the Lists from the Programmer's Toolbox library?

0 Kudos
Message 2 of 6
(3,422 Views)

One of the advantages is, that you can remove or insert single items in the list, without having to reorganize the whole list. Because of that, there is no default order of items in the list, its a simple collection of items with the same type. If you want the items ordered, you have to sort the list with the function ListQuickSort or ListInsertionSort. Alternativley you can add elements sorted with the function ListInsertInOrder.

 

0 Kudos
Message 3 of 6
(3,421 Views)
ok, but -thinking in JAVA- if the collection is a "List" (and not a "set" or "map") I thought the order stays just like the order I put the items into the list ?

best regards

Simon
0 Kudos
Message 4 of 6
(3,416 Views)

Hello Simon,

The order of the List items should indeed remain the same. I'm also using Lists and I never got any problems with the order. Are you using the function ListInsertItem to insert the items? And are you using FRONT_OF_LIST or END_OF_LIST as the last parameter for this function?

0 Kudos
Message 5 of 6
(3,411 Views)
ok, I am a fool: the index of the lists begins with "1". (who ever makes such things!)

best regards
simon
0 Kudos
Message 6 of 6
(3,381 Views)