12-16-2008 02:42 PM - edited 12-16-2008 02:43 PM
I have a front panel with (IMO) too many controls. To help deal with all of them I build an arrary of references that I can index or pass to subs. However I noticed that every control ref produces a coersion dot when I build them into an array. Two questions:
1) Is there a way to avoid this? and
2) If not, will it cause problems later if I am trying to find a specific one by comparing it to other control refs?
Solved! Go to Solution.
12-16-2008 02:51 PM
1) no
2) yes (maybe)
All elements in an array can only differ in thier value. The coercion dot is telling you that those refs are being cast to a generic type. If you count on the ref being a specific type then you will run into issue.
Rather than building an array I'd suggest creating a cluster (type def'd) with the proper ref types. This makes my development easier since I don't have to count to find a ref, I can just pick it from a list (unbundle by name).
Just trying to help,
Ben
12-16-2008 02:52 PM
12-16-2008 03:25 PM
12-17-2008 04:07 AM
StevenD wrote:will it cause problems later if I am trying to find a specific one by comparing it to other control refs?
That depends on your LabVIEW version and on where you get the reference from. There was an issue in 7.x and earlier where comparing different references to the same control would fail if the reference was strict vs. non-strict. This was fixed in LV 8.0.