LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a property of a substring fails only during first execution.

Run this VI 2 or more times and you will see it perform as I intended it to i.e. the lines containing the word red show up in red, and the remaining lines show up in black. However on the first run after the front panel values are reinitialized, the output string shows up completely in black.

I'd appreciate any ideas on how to get this VI to work.
S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 1 of 3
(2,586 Views)
It fails because there is no text in the indicator the first time.

You are setting the attributes BEFORE you set the text into the indicator.

With no text present, you can't set SEL START or SEL END to anything but 0.
Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 2 of 3
(2,586 Views)
The reason it fails the first time is because there is no text in the string indicator to act upon. On the second and subsequent executions, if the text is left in the indicator, the property change will take effect. To test this, clear the indicator between each run, you will see that it does not set the colors as you desire.

So, put the text into the indicator first, then change the properties. Attached is a modification of your vi.

Tim
0 Kudos
Message 3 of 3
(2,586 Views)