08-29-2008 02:18 PM
I am working on a simple widget to compare two snippets of text. The string controls are side by side with a colum of square bools in between
the two string controls.
The Bools line up with the lines of text in each string control. The Bools are used as a quick indicator that at that line point there is a difference
between the two string controls.
There is a slider that allows the user to scroll up and down, the slider scrolls both string controls simutaneously.
As the string controls are scrolled I will be comparing the left and right lines of text and reflecting the match status in the Bool Colum.
The reason I need to know the length of the line of text is so each line can be compared against one another. It is not as simple as counting the
col width of the string control and parsing the text because if there is a line return the text will word wrap before before it extends all the way accross the string control, which will cause parsing discrepencies.
Any suggestions on obtaining the multi line string control text character length would be much appreciated.
Best Regards
Tim C.
08-29-2008 02:22 PM
08-29-2008 03:16 PM - edited 08-29-2008 03:19 PM
Why not just convert the string into an array of strings separated at the linefeed. Then you can pick off each element as a line of text, and you can get the length by simply using the string length function.
You could also use the Scan String for Tokens function by using the linefeed.