LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete array element from array constant...

I'm sure this must be a no-brainer but I'm stumped. I've got a constant
array of strings and I want to delete an element from the middle of this
array. When I select the element and delete, all my other array elements go
away with it. Is there some fundamental concept I don't understand at work
here?

Thanks,
Jim
0 Kudos
Message 1 of 5
(7,944 Views)
Jim wrote:

> I'm sure this must be a no-brainer but I'm stumped. I've got a constant
> array of strings and I want to delete an element from the middle of this
> array. When I select the element and delete, all my other array elements go
> away with it. Is there some fundamental concept I don't understand at work
> here?
>
> Thanks,
> Jim

Not necessarily a no-brainer; it's not as intuitive as being able to remove an
element "visually," which might be nice.

You're going to have to do the deleting programatically, rather than just
selecting the string control or constant in the array while you're in "Edit"
mode and hitting , which wipes out all the elements as you describe.

You'll want to wire your array into the "Split Array" function, take a subset
of on
e of the resulting arrays with "Array Subset" (which one depends on how
you specify the index while splitting it), then rejoin the arrays with "Build
Array." The online help can guide you with these functions.
Now if this a constant array (i.e., on the diagram), just wire the result of
all the above into an array indicator, then you can pop up on the node for the
indicator on the diagram and create a new constant.

Rod
0 Kudos
Message 2 of 5
(7,944 Views)
MIGHT be nice? Holy cow, everything else is visually edittable, why not
array elements?. Come on NI, I know you can do better than that!


Roderic Don wrote in article
<39C8F73A.6C22BDB1@ccm.udel.edu>...
snipped...
>
> Not necessarily a no-brainer; it's not as intuitive as being able to
remove an
> element "visually," which might be nice.
>
0 Kudos
Message 3 of 5
(7,944 Views)
Jim wrote:

> MIGHT be nice? Holy cow, everything else is visually edittable, why not
> array elements?. Come on NI, I know you can do better than that!
>
> Roderic Don wrote in article
> <39C8F73A.6C22BDB1@ccm.udel.edu>...
> snipped...
> >
> > Not necessarily a no-brainer; it's not as intuitive as being able to
> remove an
> > element "visually," which might be nice.
> >

I am not sure about constants but in 6i this has been put in.

Kevin Kent
0 Kudos
Message 4 of 5
(7,944 Views)
Jim wrote:
>
> I'm sure this must be a no-brainer but I'm stumped. I've got a constant
> array of strings and I want to delete an element from the middle of this
> array. When I select the element and delete, all my other array elements go
> away with it. Is there some fundamental concept I don't understand at work
> here?
>
> Thanks,
> Jim
Jim,

1.Move with a help of an array index control to desired element.
2.Select an array constant.
3.Right-click on array constant digital control and select Data
Operations in pull-down menu; then Start selection.
4.If just one element needed to be deleted, next select End Selection
from pull-down menu.
5.In the same pull-down menu select Cut data.

Voila, your element(s) deleted. The same works for an array control.

BTW
, as an answer to some writers, before somebody fires to NI, study
LabVIEW properly.
Kevin is right in LV6 it's simpler than in LV5.

Best Regards to all,
--
Sergey Krasnishov
____________________________________
Automated Control Systems
National Instruments Alliance Member
Moscow, Russia
sergey_acs@levsha.ru
http://acs.levsha.ru
Message 5 of 5
(7,944 Views)