05-26-2008 03:11 AM
1) How can I give to the elements of a cluster, specific
names?
Of course, I can use "bundle by name" and a cluster of constants having the names
I intend to use but this is not what I mean. For example, let's say I have 20
property nodes linked to 20 controls which are not members of a cluster (or are
not members of the same cluster) and I need the property "visible" (or
"disable" etc). Now let's say I want to bring them together in a
cluster. The problem is that all the cluster elements are now called "visible" (or
"disable" etc) and what I want is to give them the names of the
corresponding controls. More than this, I want that, when I change the name of
a specific control, the name of the element of the cluster to be changed
accordingly.
2) Conversely, how can I get the name of an element of a cluster?
I can use "unbundle by name" to select it, but this will give the
value of its data, whatever it is. The question is, how can I get it's name?
3) This is, somehow, a combination of the previous two. Sometimes is more
convenient to use arrays to process data, instead of clusters. But using
"cluster to array" and then "array to cluster" the names
are lost, again. I could use "unbundle by name" (before array
processing) and then "bundle by name" (after array processing) and connect
element by element, but in case of big clusters this is very much space
consuming. What else could I use?
4a) More than this, how can I concatenate two clusters?
4b) How can I set (not manually) the size of "array to cluster"?
Thanks a lot,
Silviu
05-26-2008 03:23 AM
Hi Silviu,
You can use the Controls[] property of a Cluster control/indicator to set/get the names of the controls/indicators in it.
This will give you an array of references to the controls/indicators present in the Cluster. You have to use Index Array function or the For loop to auto-index the controls/indicators present in a Cluster to set/get the desired properties of those elements in the Cluster.
Moreover, you can index this Controls[] references & use the Class ID to find what type of control/indicator it is & set/get its properties accordingly.
05-26-2008 03:23 AM
05-26-2008 03:29 AM
Hi Silviu,
Bundle by Name & Unbundle by Name will give only the values of the elements inside a Cluster, not their names [label/caption].
It is better & easier to play with the Caption names in run-time, because Label names are fixed thro' out your program, both at design time & run-time. The ability to write to the property, label.text programmatically may confuse a bit, but it will throw an error while running, saying that the Label name of a control/indicator cannot be changed at run-time.
05-26-2008 03:46 AM
05-26-2008 03:49 AM
Hi psilviu.
why don´t you tell us the purpose of this. May be there is another solution. What type have your 20 signals, have they all the same type?
Mike
05-26-2008 03:56 AM
05-26-2008 04:06 AM
05-26-2008 04:07 AM
05-26-2008 05:25 AM
psilviu wrote:
As I said, the elements of the cluster I talk about are not members of a cluster existing on the front panel. They are simply 20 signals grouped together in a cluster. They come from 20 property nodes and they are all named (in the created cluster) "visible". So, how can I use in this case the property "controls"?