LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can I programatically format array of strings?

I am using a 2D array of strings to display a memory map.

 

One of the things I was interested in doing was highlighting individual cells that might be changing values (in this case, in general the values should remain constant).  So, for instance, if a value is changing, highlight it in red.

 

Is there a way to programatically do something like this to a single cell?  In playing around with the formatting features, it appears that any change made to a single cell effects the entire array.  Even for instance when I justify-centered an element.

0 Kudos
Message 1 of 7
(3,238 Views)

Yes, if you change the properties of the array element, it will change the rest of the elements in the array. You can use a table or listbox and control the color of the cell. If you don't want to use a listbox or table, you can create a cluster of color box and text control. Make both controls the same size and put the text control in the front. Set the background color of the text control to transparent. The color box will be the background. See attached example.

0 Kudos
Message 2 of 7
(3,221 Views)

hi bmishoe,

 

could you use a table instead of an array? Via property nodes you can manipulate the background color of the active cell:

 

Unbenannt.png

 

Unbenannt2.png

 

 

 

alsdo see:

labview\examples\general\controls\Table Enhancements.vi

 

 

-------

 

EDIT: Ok, someone else was quicker ...

 

 

 

Alex

 

0 Kudos
Message 3 of 7
(3,211 Views)

I have not used tables before, I will look into them.

 

To give a little more detail...this memory map will be constantly updating.  What I'm hoping to do is programatically determine what values are changing between updates, and highlight the text or the background of that cell in a different color...

0 Kudos
Message 4 of 7
(3,205 Views)

You will have to use a table.  Using a property node, you can set the background color of the "active cell".  You also set the active cell and therefore only color the cells you want to.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(3,203 Views)

thank you for the help...I'll give it a try!

0 Kudos
Message 6 of 7
(3,199 Views)

Changing the background or font color of individual table cells is quite simple and I have posted many examples in the past. If the table is large and you change many cells, you should defer panel updates to make things more efficient.

 

Here is an example changing the font color (includes defer panel updates). (original thread)

 

Here is an example changing the background color. (original thread, run VI, press "update" button))

 

 

0 Kudos
Message 7 of 7
(3,176 Views)