LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programatic control of captions

Friends:

I know it is possible to programatically change the caption of a item
through use of the attribute node.

But I would like to do is programatically set the captions of items
(e.g. booleans) in an array. For example I have an array of strings
which I would like to use to set the captions of the individual elements
in a array of booleans. I would like to avoid have to do each element
individually.

Is this possible?

Thanks,

Donal Day
0 Kudos
Message 1 of 6
(2,624 Views)
Donal Day wrote:

> Friends:
>
> I know it is possible to programatically change the caption of a item
> through use of the attribute node.
>
> But I would like to do is programatically set the captions of items
> (e.g. booleans) in an array. For example I have an array of strings
> which I would like to use to set the captions of the individual elements
> in a array of booleans. I would like to avoid have to do each element
> individually.
>
> Is this possible?
>
> Thanks,
>
> Donal Day

From what I understand, in an array changing the Label or Caption
of one item makes all of them change. This is just a behavior of arrays.
V5.1 does this, not sure about other versions.
Kevin Kent
0 Kudos
Message 2 of 6
(2,624 Views)
I usually do this by creating an array of strings, and then put in the
string that I want to label it. I make the colors of the string array
transparent, so you can put it on top of buttons to change the button
label.

Mark

In article <39AAAFC0.5434C834@usa.alcatel.com>,
"Kevin B. Kent" wrote:
> Donal Day wrote:
>
> > Friends:
> >
> > I know it is possible to programatically change the caption of a
item
> > through use of the attribute node.
> >
> > But I would like to do is programatically set the captions of items
> > (e.g. booleans) in an array. For example I have an array of strings
> > which I would like to use to set the captions of the individual
elements
> > in a array of booleans. I would like to avoid have
to do each
element
> > individually.
> >
> > Is this possible?
> >
> > Thanks,
> >
> > Donal Day
>
> From what I understand, in an array changing the Label or Caption
> of one item makes all of them change. This is just a behavior of
arrays.
> V5.1 does this, not sure about other versions.
> Kevin Kent
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.
0 Kudos
Message 3 of 6
(2,624 Views)
Kevin B. Kent wrote in message
news:39AAAFC0.5434C834@usa.alcatel.com...
> Donal Day wrote:
>
> > Friends:
> >
> > I know it is possible to programatically change the caption of a item
> > through use of the attribute node.
> >
> > But I would like to do is programatically set the captions of items
> > (e.g. booleans) in an array. For example I have an array of strings
> > which I would like to use to set the captions of the individual elements
> > in a array of booleans. I would like to avoid have to do each element
> > individually.



Alternatives, depending on what you want to do, are to either have an array
of clusters, in which each element holds a string (for the caption) and a
control or indicator of whichever type you w
ant (if you need it to be a
control, simply use locals to load the string elements, being aware of the
problem if you reload them while the user is typing values into the
controls!), or to make a separate array of strings next to or above the
front panel array.

The second option is better if the arrays are small and of fixed length so
the user doesn't need to scroll indices, the first is better if the array is
large.
0 Kudos
Message 6 of 6
(2,624 Views)
Donal Day writes:

> Friends:
>
> I know it is possible to programatically change the caption of a item
> through use of the attribute node.
>
> But I would like to do is programatically set the captions of items
> (e.g. booleans) in an array. For example I have an array of strings
> which I would like to use to set the captions of the individual elements
> in a array of booleans. I would like to avoid have to do each element
> individually.
>
> Is this possible?

It should be possible in a cluster. You can play around with "Array to
cluser" and vice versa.

Johannes Niess
0 Kudos
Message 4 of 6
(2,624 Views)
You can access a parameter node for the control. Just popup on the
control in the block digram, and create a property node. From there you
can set or get certain properties.
0 Kudos
Message 5 of 6
(2,624 Views)