LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reducing the size of a 1D array

i have a rather silly question...

but this small thing is being used in a big code and creating problems.....

I have a 1D array and by using the size function i am finding its size.

But when i delete some elements from the array, the size function still shows the original size.... and this spoils the functioning of the entire code....

So, I can only add elements and increase the size but can never delete elements and reduce the size.... how to go about it???? thanx.....

0 Kudos
Message 1 of 9
(3,373 Views)

Hi, 

 

I suppose you are talking about 2-D array. I think in labVIEW a 2-D array will always be square. That means even if the number of elements in each row or column varies, the size will be decided according to the row and column with maximum number of elements. But  when a 1-D array is considered , if you delete an element the size also is reduced by one.

 

Even I am interested to know if there are any alternatives.:)

 

Regards,


Nitzz

(Kudos are always Welcome, Mark as a solution if it is the One;))

0 Kudos
Message 2 of 9
(3,367 Views)

i am talking bout 1D array only....

but after deleting the element.... the size is not decreasing..... r u sure its decreasing for u?? 

0 Kudos
Message 3 of 9
(3,362 Views)

You should post the code you are using.

It certainly works correctly for me in v 8.5.

 

Ian

0 Kudos
Message 4 of 9
(3,355 Views)

Hi,

 

This is how i tried. May be sharing your code will help me understand better your problem.

 

Regards,


Nitzz

(Kudos are always Welcome, Mark as a solution if it is the One;))

0 Kudos
Message 5 of 9
(3,354 Views)

u mean i have to use the delete from aray function each time???

cant i just delete the last element from the control panel.... and thus reduce the size by one??

0 Kudos
Message 6 of 9
(3,340 Views)

it works fine..

0 Kudos
Message 7 of 9
(3,330 Views)

right click the element..... data operations>> delete element.....

that seems to be the way to remove the element from the control panel..... 😛 😄

Message 8 of 9
(3,315 Views)

Thank you, Preetisar.  I spent almost an hour trying to find the answer to this very simple question.  It is such an elementary operation but in no way obvious.

0 Kudos
Message 9 of 9
(3,257 Views)