LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
P@Anand

Properly Insert "Delete from Array"

Status: New

When I Right click a wire and tried to insert a "Replace array subset" its getting inserted properly but the same doesn't work with the delete from array and I had lot of instances where I have to insert a "delete from array". I am proposing this after searching this forum but If already proposed then I'll try to give Kudos for that.

 

Replace array full.png

 

So without broken wire it would be nice to insert a "Delete from array" function.

-----

The best solution is the one you find it by yourself
7 Comments
jcarmody
Trusted Enthusiast

The position of your mouse pointer affects how the node is inserted.  It works fine if you invoke the insert when your tool is positioned as shown below.

demo.png

If your tool is on/above the wire you'll get what you showed.  That this is a pain in the neck is another discussion.

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

P@Anand
Trusted Enthusiast

Yes I checked it and it works but still for the other case (Replace array subset) it gets inserted whatever the tool may be. I would still stand to fix it so that no more discussion required. 🙂

-----

The best solution is the one you find it by yourself
parthabe
Trusted Enthusiast

Hi folks,

 

There seems to be a lot of inconsistencies if you start testing for the 3 Array functions (Insert, Replace & Delete) across different datatypes.

 

  • Unlike jcarmody said, it works for Numeric datatype ( tested for DBL & I16) always, whatever the tool may be (works for even Text tool).
  • For Bool array, inserting a Delete from Array function or, for that matter, an Insert Into Array function with Arrow cursor, always breaks the wire (but Replace Array Subset function gets inserted properly). But, for Str array, it works sometimes, it breaks sometimes.

 

So, this problem is not only present for Delete from Array function, but could be for other Array function(s) as well. Smiley Happy

- Partha ( CLD until Oct 2027 🙂 )
AristosQueue (NI)
NI Employee (retired)

It's not inconsistent... it just isn't customized. 🙂

 

The same algorithm runs insert for all nodes -- it tries to match terminals until it finds a good type match, and it happens to give priority to outputs than to inputs (because that minimizes the number of coercion dots that might appear). So on Delete, it matches the second output (not match exact, but array is close enough, and is a tie in terms of type distance + physical distance with the top terminal... the physical distance element is why mouse position with respect to the wire maters... that addition was made a few years ago because there are nodes where both top and bottom insertion is equally desirable based on conditions). Then it tries to match the input and none of the types match -- because Delete defaults to an array of numeric. Finding no type match, it uses the most aligned terminal with the chosen output.

 

Very consistent, but not what you want. We would need to add custom code specific to inserting this particular node.

 

I've struggled over the years to figure out a way to have a generic insert algorithm that takes into account the various special cases and have come up empty. I -- and others on R&D -- have coded a few exceptions in over the years, just never got around to these.

 

I mention all of this in case anyone has suggestions for a generic algorithm without knowledge of the specific workings of the node being inserted that would work to get more nodes inserting correctly than we have today.

X.
Trusted Enthusiast
Trusted Enthusiast

It is not just insert. Replace suffers ftom the same issue.

If I try to replace this "Insert Array Subset" function by a "Delete from Array" function, you would think that mouse position shouldn't matter.

It doesn't, but the result is bogus:

 

Screen Shot 2015-02-19 at 14.21.54.png===> Replace by "Delete from Array" ====> Screen Shot 2015-02-19 at 14.22.30.png

 

Hint: the index should stay an index (Super Hint: in particular when the object has nothing to do with an numeric).

P@Anand
Trusted Enthusiast

This is similar to replacing a VI with different connetor terminals. I wouldn't call this as a bug instead I would call it a "Feature request". This could be suggested seperately.

-----

The best solution is the one you find it by yourself
X.
Trusted Enthusiast
Trusted Enthusiast

Sure, except this is not a VI.

I think it is related to your suggestion, which is why I did not post it as a separate thread.