LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why are local variables created in opposite order?

A nice new feature in 2012 is being able to select multiple terminals (or controls) and create local variables for the group.  If I drop a numeric control and then use control+click to copy it a couple times, creating a column:

local terminals.png

 

Then lasso the column and Create->Local Variable, ther resulting variables are created in the opposite order:

 

local vars.png

 

Direction of lasso doesn't matter (top to bottom or bottom to top).  It would be nice if the lasso option created them in the same vertical order.

(If I individually select the terminals they are created from top to bottom in the order they were selected.)

 

0 Kudos
Message 1 of 7
(2,522 Views)

Very odd - if you weren't careful, you could end up wiring the wrong ones to the wrong place.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 7
(2,514 Views)

Probably based on the z-order of the controls if you select multiple items at the same time.

 

Try reordering the controls on the block diagram (move forward, move backward, move to front, move to back) before selecting them at one time and see if that changes the results.

 

Since numeric 5 was probably created after 4, which was created after 3, 5 is probably more on top in the z-order compared to 4, then compare to 3, .....

0 Kudos
Message 3 of 7
(2,513 Views)

It does appear to be driven by the z order.  Re-ordering the terminals changed the order of the local variables.  But I think it should be creating from 'back to front' instead of 'front to back'.  Having to reorder is not a practical solution.

 

I suppose I could get used to created controls/indicators in the 'opposite order', but shouldn't tools make life easier?  Is there a coherent design reason for the current behavior?

0 Kudos
Message 4 of 7
(2,502 Views)

@DAD wrote:

Is there a coherent design reason for the current behavior?

Probably not. This behavior (the order of the selection list) predates this new feature by many years and when it was first implemented the specs for it probably weren't that good, since it was probably a private property. I'm guessing it's just an accident.

 

Incidentally, the reverse Z order thing is for each group in the selection, so if you shift-select a bunch of control and then shift-select a few others, you'll get two groups sorted by reverse Z order. I agree that it's annoying, but I don't think anything's ever been done about it. I suggest an idea exchange entry if one doesn't already exist.

 


___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(2,493 Views)

I think there is a logical reason why the highest z-order item gets picked first.  Imagine you were just trying to pick one object out of several that were laying on top of each other.  Of course you'd expect the one on top, the one the users sees, to be the one picked.  You wouldn't want an underneath one to be selected.  You might not even see that it was selected if it was completely hidden.

 

The selection mode for multiple items in a selection box is probably just an extrapolation of a single item selection.

 

Of course this doesn't give you the results that you want or expect for this create local variable menu choice.  As tst said, the methods of selecting objects predates the recent methods of creating new objects on a multiple selection.

 

Probably what should happen is that the new variables be created and positioned in an order relative to the X and Y coordinates of the selected objects on the screen rather than the z-order.

0 Kudos
Message 6 of 7
(2,467 Views)

Perhaps you are being sent a subliminal message about mass-creating local variables.  Smiley Very Happy

 

 

Spoiler
I do actually agree with you: if LV is going to allow you to do something, it should be done as intuitively as possible.

 

0 Kudos
Message 7 of 7
(2,455 Views)