LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing element properties on array of clusters

Hi,

 

I have an array of clusters (pic in attachment) and i would like to know if its possible to change the background color (for example) of a single element without.

 

Regards,

Pedro

0 Kudos
Message 1 of 4
(2,312 Views)

No

In an array of anything (cluster, strings, numbers) the back ground color is the same for all elements.

You can not change the color of just one element.

 

You can add a color box to your cluster and set it color different for each element.

Set the control to transparent and place the color box behind it. 

Omar
0 Kudos
Message 2 of 4
(2,306 Views)
Message 3 of 4
(2,299 Views)

Omar is pointing at an important point about arrays. With an array every element is seen as being logically identical to every other element. Consequently, the only thing that is (or can be) different from one value to the next is the value. That is why Omar's solution works: it depends on a changing value; and your original idea does not: it depends on a changing property.

 

However it's not just color. No property can be different between elements.

 

This all ties in when deciding what datatypes to use. Many people think the decision between array and cluster is simply a matter of the item (or element) datatypes. But its more of a matter of the logical meaning of the values. You could put the height, length, breadth and mass of a box in an array because all the numbers can be represented as floating-point values. But this would be incorrect because the values logically represent different things. In this case, the proper datastructure would be a cluster.

 

And this difference can have practical implications: like for instance if I need to extract the length I need to remember that it is element 2 -- or is it 1... See what I mean?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 4
(2,292 Views)