LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Julien_De_Freitas

Have the possibility to keep the order number in a cluster when an element is deleted

Problem:

For example I created a type definition with a cluster of four controls. I populated this definition in my program (about 100 VIs).

I am deleting now the second control of my type definition. Of course this new definition is now populating everywhere.
The order is not kept.

 

Idea:

It should be possible to keep the previous order. I need an extreme long developement to develop and redo everything in my program afterwards.

 

Screenshots:

Capture 1: Defintion + 3 uses in a VI

Capture 2: Deletion of the second control + the order is not kept: the control 2 is in Position 1 and control 3 in Position 2.

Julien De Freitas

Applications Engineering Group Leader / Certified LabVIEW Developer (CLD)
National Instruments Switzerland
Download All
8 Comments
A-T-R
Member

Hi Julien, although I understand why you want to have this feature, I'm not convinced that this is the right approach.

 

As an general workaround, you could search for the label or caption text by using the Control references array of the specific cluster until the desired element has been found for accessing, and than you would be independent of it's position within the cluster.

 

Regards A-T-R

crossrulz
Knight of NI

The order is kept.  You just eliminated one, so the rest just come down in number by one.  Seems quite logical to me.

 

It is like deleting an element in an array.  Would you expect all of the items after that deleted item to keep the same index number?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Julien_De_Freitas
NI Employee (retired)

Hi crossrulz,

 

no but I would like to have an option to do so.

Julien De Freitas

Applications Engineering Group Leader / Certified LabVIEW Developer (CLD)
National Instruments Switzerland
jcarmody
Trusted Enthusiast

You begin with, say, an array with ten elements.  When you delete one element you want  an option to return an array with ten elements?

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

altenbach
Knight of NI

If your code is so fragile that it breaks when a type definition is changed, you could instead just hide the element that you no longer want to see. You migh even need it again in the future. 🙂

X.
Trusted Enthusiast
Trusted Enthusiast

I am not sure I understand what your snapshots are supposed to show.

If I try to reproduce your steps (delete one element of the cluster), the unconnected PN is the one formerly associated with the deleted element.

In your snapshot, it would seem that the REFERENCES to the elements are mixed up. They ar not!

As far as your broken "bundle" by name, I don't suppose you to expect this to be fixed magically?

AristosQueue (NI)
NI Employee (retired)

This is a logically impossible request. You cannot have a cluster of 5 items and expect to index item #6. If you would like to add more elements to your cluster to keep your indicies the same, that's fine, but an index is an index.

Darren
Proven Zealot
Status changed to: Declined