LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

[very simple] delete string array subset, please help

Hi all,

 Could you please help me in the problem?

Assume I have 4 string and they are in an array

for example,

boy
girl
man
woman

So the array size is 4, Now I want to delelte "man" to make the string array become

boy
girl
woman

I have no clue how to do that, I can do it if it is number instead of string
Could you please help me

Thanks

Marco




====================
=Labview 7.0 & 8.0 & 8.5=
=====================
0 Kudos
Message 1 of 7
(3,144 Views)
Simply said, you just have to find the index of the element you want to delete, and wire this index to the remove element function.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 7
(3,143 Views)
But if I don't have Labview 8 ? What should I do?

Thanks
====================
=Labview 7.0 & 8.0 & 8.5=
=====================
0 Kudos
Message 3 of 7
(3,136 Views)
Basically the same..
Either you use the built in function to find the element in the array (I remember I once had problems when trying to find string elements in an array) or you search the element on your own.
Iterate over the array until you find the element. The "Delete from array" function should also be available in earlier versions of LV.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 4 of 7
(3,136 Views)

Below is an image of how to implement what Becktho described.

On the block diagram, look in the Functions Palette, under Array for the vi's shown.

You can notice that woman is now the first element of the array and man is the element that was deleted.

 

Message 5 of 7
(3,128 Views)
Thanks. I misunderstood that function, I thought it was only work with numeric arraySmiley Wink
Thanks again. I have given you 5 stars on the last two messages

Marco
====================
=Labview 7.0 & 8.0 & 8.5=
=====================
0 Kudos
Message 6 of 7
(3,128 Views)
If you're not sure if you can use a function with a certain datatype, just test it. A lot of LV vis are polymorphic and can handle various datatypes.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 7 of 7
(3,124 Views)