LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
acolbourn

Ability to copy structures and decide between making new variables or using locals of existing variables.

Status: New

For example, if I had a case structure with 50 cases and one variable in each case, I would like to be able to copy the case structure and have a new identical case structure with 50 matching local variables.  Currently it makes 50 new variables, so having the option to choose between generating new ones and generating locals of the existing would be extremely useful.  

4 Comments
altenbach
Knight of NI

You can simply ctrl-drag the existing structure and it will make a second copy with all existing local variables retained. (try it!)

 

(Still, I think you are using the wrong code design pattern. This sounds like a nightmare to begin with. :D).

elset191
Active Participant

I think when he said "one variable in each case" he meant "one control or indicator in each case"  That's how I read it anyway.  If that's the case ctrl+drag would not help.

 

If he actually meant variable, then this is basically a duplicate of Fix Copy/Paste for property nodes, local variables, etc I think

--
Tim Elsey
Certified LabVIEW Architect
altenbach
Knight of NI

> I think when he said "one variable in each case" he meant "one control or indicator in each case" 

 

No real way to tell, but after looking at this post, you might be right. I always cringe when I hear the word "variable". 😉

 

In any case, once such a structure is copied to the clipboard, how should later it know where it came from?. Apparently there should be a different result, depending on pasting it back to the same VI versus pasting it to a new VI?

acolbourn
Member

Hey guys,

Sorry, meant to say one indicator in each case.  ctrl+drag ends up creating an entirely new set of variables.  The situation arose when my work decided it needed 50 separate indicators on the screen instead of the array I had (they wanted me to make each item physically look like a temperature controller as opposed to just a boring array of numbers).  Anyway, to make it work with my old program I had to put each indicator in a case from 1 to 50, but when I hit ctrl+drag to use it somewhere else in the program it generated new variables 51 - 100.  This meant I was forced to remake the case structure by coping local variables of each indicator.  You can then ctrl+drag if you're using local variables but if you use the original indicator you get new copies.  An option such as "copy by generating local variables" would be awesome.