From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Optimization code for controls selection

Solved!
Go to solution

Hi,

I have write simple main program (as attach) for the controls selection.

The selection item will be highlighted and allow user to click & it will call a subvi and minimize the main.

Some item selection will prompt a listbox that further allow user to click contents of the listbox & call a subvi and minimize the main.

As i will have plenty of selection item controls (20x) and listboxes (8x) and it make the overall program very complicated.

So, any advice for the code improvement?

Thank you.

-Simon

 

Download All
0 Kudos
Message 1 of 2
(2,119 Views)
Solution
Accepted by topic author SimonChin

As it is, it's quite straight forward.

 

If it gets more complicated, you should abstract this in some way. But without knowing the details of the logic involved, it will be hard to advice.

 

I'd group controls in classes (like QControls), or enable\disable by control labels, or arrays of references, or clusters of references, but it all depends on the details.

Message 2 of 2
(2,064 Views)