LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

programming string value destroys format

I have attached an example VI that shows that the text string formattting remains unchanged as long as the value doesnt change.  The font colors and styles remain the same as they were programmed.  Once the value is changed, the format of the text string object kind of loses its mind and starts underlining the entire text string.

 

Is there a reason for this and is there a way that you can maintain the text string font color and style while changing the value?   I am needing some help on this arena...

0 Kudos
Message 1 of 5
(2,537 Views)

Hi,

 

format is changing because you applied corrections to font for few characters only. It is applying changes in font only to the selected text....try without that option and see..font stays even though u change value

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 2 of 5
(2,514 Views)

Thanks for the response but I need to select certain substrings and color them differently by each line of the string depending on system information that I get that needs to be displayed something like this.

 

Fault 1 OK

Fault 2 OK

Fault 3 Bad

Fault 4 OK

Comm Fault OK

System timeout Failed

 

 

Any ideas?

0 Kudos
Message 3 of 5
(2,509 Views)

The text font that is first set becomes the default font for the whole string. When you first select characters 0 to 6 the red underline font settings become the active setting for the whole string. When you set New Value 1 the selected text (char 3 to 21) will be blue but all the characters that are not selected (0 to 2 and 21 to 32) will have the new font settings (red underline). Then, when you set New Value2 the new text will get the red underline default font setting.

 

Probably you will have to track what was selected or not and apply settings individually to all these string sections.

 

Ben64

0 Kudos
Message 4 of 5
(2,480 Views)

I always get a little peeved when formatting text.  What I have done for other attributes but have now adapted for color is to use tags <color>text</color> and borrow a little from the Bold Particular String.vi in vi.lib.  This is done pretty quickly so it may not handle all use cases (don't nest, check spelling).  If you want to change tags and/or add colors change the default value of the cluster array in Color String.vi.

 

Hope this helps.  You use one string (you don't have to display it) to keep the raw data and just display it using these VIs.

 

StringColor.PNG

 

P.S. No I have still not resolved my licensing issue.   Argh.

Message 5 of 5
(2,469 Views)