LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

uir header file control's definition value

You do well to test your code on new versions. You'll catch the problem if the CVI behavior changes, but you'll still need to fix it. My cautious approach is to avoid using undocumented features.

Using an array of control IDs, unless you intentionally change the group of controls, you don't need to modify the original array. There are no unintended consequences. Using the tab order, you have unintended consequences if you copy a control: your tab order just changed. Unintended consequences are usually unpleasant surprises to anyone else supporting your code. If you intentionally make a change, it's usually easier to catch any problem related to your change.

Sorry I overstated it when I said ANY change in the UI editor could affect your tab order. I was meant copying , adding, or deleting controls. But again, since this is undocumented and we don't have anything written in stone describing the behavior, we don't know what changes will affect the tab order.

To follow your comment about abandoning ship, you should wear a life jacket, not a flak jacket. Here's my analogy.
There are two channels between point A and B. It is debatable if either channel is faster. Channel A is clearly marked and will not be changed. Channel B is not clearly marked (undocumented) and has some submerged rocks. These rocks haven't moved in years, but may at some time in the future. I say "Take Channel A". You say "I'll take channel B. I know where the rocks are. If the rocks move in the future, I'll fix my boat." I wish you smooth sailing!
0 Kudos
Message 11 of 15
(1,586 Views)
Cosmo,

The tab approach is an intersting solution, and it's definately not something that I ever knew about before, so I'm glad that you posted it. It's always good to learn about the subtelties of a compiler because you really never know when you might need them.

With that said though, I have agree with what Al is saying about using an undocumented feature. In my opinion the major problem from relying on undocumented features isn't that they might not be supported in the future (though this could be a problem) but more so that that they are simply put, undocumented :-). The thought being that the code any of us writes today may not be maintained by us tomorrow. And because the feature is undocumented the next person to use CVI to maintain my code may not know that the tab order of controls also determintes the numerical order of each control #define. On the flip side, I would trust that if I used arrays to store my contorols the next person who comes along would be able to see what I was doing, and add/remove the necessary code.

But really the main point of this whole post is that it does bring up the need for a true "documented" method that allows the maintenance of #define order for controls. Perhaps a feature for LabWindows/CVI 7.xyz :-).
0 Kudos
Message 12 of 15
(1,576 Views)
Fair enough,
I will try to limit my future posts to features that I believe are documented. I think it may be educational to post other interesting things that I have found over the years, but I will certainly try to do so with a disclaimer. How does that sound?

Orlan
0 Kudos
Message 13 of 15
(1,565 Views)
Don't limit your posts because I disagreed with your approach. This is a discussion forum. It's fun and enlightening to see other people's approach. Sometimes it takes an undocumented approach to solve a problem.
I'd like to see what other tricks you have up your sleeve.
0 Kudos
Message 14 of 15
(1,560 Views)
Cosmo...You dont need to put any disclaimer...It was good insight and everyone programs differently...I'll will use the tab technique in certain panels.
0 Kudos
Message 15 of 15
(1,558 Views)