LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
X.

Provide an "Array Index" output for the "insert" and "delete element from array" events

Status: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.

There are two undocumented events for arrays:

 

APP_SC_DELETE_ELEMENT

APP_SC_INSERT_ELEMENT_BEFORE

 

which are unfortunately lost when you replace the array contextual menu by your own.

 

They could in principle allow finding which element a user has deleted or inserted. Indeed, sometimes "OldValue" and "NewValue" are not enough to infer this information (think about identical values in an array).

 

BUT

 

The only additional information currently provided is "Coords", which tells where on the FP the user event was generated.

In principle, it should be feasible to get back to the location of the element involved and from there find out the element's index, but add scrollbars, panels etc, and that rapidly becomes a project by itself. Moreover, you can "insert" a value to the end of an empty array control and the inserted element will anyway be "inserted" as the last element (which also be the first and only element).

In other words, after having carefully computed where the click took place, you will still have to figure more about the control itself to make sure all the corner cases are covered. Big PITA.

 

Instead, I'd suggest to have both events also output the array index (or colum/row, in the case of a 2D array (*)) where the event occured. This is a known information to LabVIEW, since the control is updated just fine.

 

Now there is still the issue that the insert and delete element events are accompanied by a synchronous "Value Change" event, but that can be dealt with in a rather simple way (as long as you are aware of it).

 

So in summary, my suggestion is, as the title indicates, to provide an "Array Index" output for the "insert..." and "delete element from array" events

 

(*) Notice that there is no such shortcut event for array with higher dimensions...

1 Comment
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.