From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete from array

Hi :

 

I want to delete element from array that contain word " Default:" , I have succedd to delete one one element but I don't know what I am doing

wrong with my vi

 

attach see file plesae

 

thanks

Wisam

0 Kudos
Message 1 of 2
(1,965 Views)

You want to use replace array subset so you can reuse the buffer. If the item does NOT have the word default in it, you put it back in the array. If it does, you don't. The other case is 0.. The case shown is called Default, but has nothing to do with the word default you're searching for so don't be confused. That is what LabVIEW names the case to show it will handle any case which you have not defined within the default case. Then you trim the array at the end. This reuses the existing buffer. Keep a counter for the number of elements you've added back into the array so you know how much to trim and at what location to insert an element. If you have LabVIEW 2012, look into conditional indexing. But, this is not as memory efficient because it does not reuse the buffer (yet). But I think NI has or will be changing this slight oversite.

 

 

0 Kudos
Message 2 of 2
(1,947 Views)