LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String formatting behavior when Selection Start=Selection End [BUG]

When using a property node to style text in a string, I found that the style will be applied to the entire string whenever Selection.Start = Selection.End.

 

Is this expected behavior?

 

I expect no style to be applied if there is no text selected. When selection start=selection end, this is equivalent to having a cursor placed between two characters in the string. When applying styles manually under this circumstance, no style will be applied to any character.

 

See attached example. LV2014

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 1 of 5
(2,448 Views)

I would guess that this is the expected behavior. Otherwise you would have to always set the selection positions in order to change the style. Therefore the default behavior assumes to set the style for the entire string when start equals end. You can try an experiment and see if the style is changed if you force end to be less than start. 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 5
(2,434 Views)

Help says

 

"

Text selection specified in terms of character positions for the beginning of selection (inclusive) and end of selection (not inclusive). If you set the start and end to be the same, LabVIEW inserts a caret into the text.

"

 

When testing I do NOT see the caret.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 5
(2,429 Views)

Hi Mark, good point. If end is less than start,t eh entire string is changed. Again, not expected, as I don't see why end can't be less than start. Here I've set a range specifically and gotten an unexpected result, but it is easy to work around. Just one of those gotchas, I guess.

 

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 4 of 5
(2,411 Views)

Not sure what is meant by a carat (probably "^"). but then that would be a really weird behavior, so I'm glad the help is wrong. What maybe should happen is that LabVIEW would insert a cursor. This is of course quite reasonable, though I believe actually selecting text is a different node than what I'm trying to do here.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 5 of 5
(2,409 Views)