NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Linked List

Is it possible to create a custom datatype in a Teststand container that would represent a linked list?

If it is possible how would you do it?
0 Kudos
Message 1 of 3
(3,295 Views)
There are several ways. You could link containers together with ActiveX references or with property objects you attach with the PropOption_NotOwning flag. However, the easiest way to have a resizable list in TestStand is to just use an array, either of container instances (easiest), ActiveX references to containers, or non-owning container properties.

You can insert items by calling the PropertyObject SetValByOffset methods with the PropOption_InsertElement option. You can delete items by calling PropertyObject.DeleteElements.
0 Kudos
Message 2 of 3
(3,295 Views)
Also, you could choose to use the tried-and-true array only solution for languages that don't have pointers (even though TestStand does have pointers, if you count ActiveX references or non-owning properties).

To create a linked list in an array, make an array of containers. Allocate new items by adding elements to the end of the array. Use a numeric nextIndex property in each container to indicate the location of the next item in the linked-list within the array.
0 Kudos
Message 3 of 3
(3,295 Views)