06-10-2014 11:35 AM
How to resize the string array automatically by extracting the maximum string length in the array? I could extract the string length and set the maximum lenth to the property nodes of array size width and array element size width and doesn't change. Would any one help on this?
Solved! Go to Solution.
06-10-2014 11:43 AM
String Length is in number of characters
The property node Text.Width is in pixels
Two differents things
06-10-2014 11:47 AM - edited 06-10-2014 11:51 AM
You are trying to find the length of the string in characters, and writing that to the Width property node which expects pixels.
You are also using the Minimum of the array rather than the maximum of the array.
There is a function called Get Text Rectangle that will give you the size of the text in pixels. The advantage is that it also accounts for the different widths of different characters in the font.
06-10-2014 12:54 PM
Just a minor tweak to RF's code to account for the strangeness that property Text.Width refers to the outside dimention of the surrounding decoration.
Without the add the "g" in "Missing" goes missing. While this looks like "Just a touch" of overkill select "Visible Items" Display style after running the vi as is
06-10-2014 01:11 PM
Very weird. Your strings do need that. (Actually makes it a bit wider than it should need to.)
When I did it originally, nothing seemed to be cut off. (Mostly it was various length strings of numbers and "asdf".) It always seemed to show the whole text.
06-10-2014 01:37 PM
Playing a bit more you should probaly subtract Left from Right in case the text is right justified. trivial
06-10-2014 01:53 PM - edited 06-10-2014 01:54 PM
@ Jeff·Þ·Bohrer Super.