LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Found a cool new LabVIEW nugget!

Hi, I'm using LV8.5 and today I found a cool nugget by accident.

If you select and copy/paste something from the frontpanel, you always get a 2 (or 3, or 4 and so on) behind it.

Past it again on the same spot and the number will dissapear.

 

 

LED

(select) (copy) (paste)

LED & LED 2

(paste)

LED & LED

 

Robot tongue

 

Hope you guys understand what I mean. It does not work in the blockpanel.

--------------------------------
The Enrichment Center is required to remind you that you will be baked, and then there will be cake.

Message 1 of 4
(2,814 Views)
This actually has been brought up before. Smiley Wink
Message 2 of 4
(2,797 Views)

Heinen wrote:

Past it again on the same spot and the number will disappear.


Nice! I never noticed that (it is actually not a "paste", because it does not create a new control). Basically, a "double" ctrl+v is equivalent to a single "paste" without creating a new name for the new control.

 

It even works if you copy a new control by "ctrl-drag" and pressing ctrl+v immediately after. This edits the new name to remove the number.

 

Overall, I prefer the name auto-increment. I don't like different things with the same name. I actually often start out with names that already have a number. For example, I would manually create a boolean called "control 1" and later ctrl-drag it to make new copies ("control 2", "control 3", etc.). Looks more consistent. 🙂 Why should the first one be without a number in the name?? 😄

 

One of the mysteries is the fact that the new control is labeled "#2", which is inconsistent with the typical labview behavior that starts counting with zero. There is one exception. If you call your control e.g. "numeric 0" and copy it, the copy will have the name "numeric 1" instead of "numeric 2". 🙂

 

It also does not like negative numbers. For example copying "Numeric -12" will create "Numeric -12 2" instead of "Numeric -11". OK, enough silliness. 😄

Message 3 of 4
(2,778 Views)
Heinen... right on! Never never noticed that before, there has been times where the auto increment bugs me.
SteveA
CLD

-------------------------------------
FPGA/RT/PDA/TP/DSC
-------------------------------------
0 Kudos
Message 4 of 4
(2,754 Views)