Dear all
Does anyone know how to count lines and words in an RTF object?
To count words I could count spaces, but I have no idea how to count the lines...
thanks
gert
Professional Software Development Tools
Dear all
Does anyone know how to count lines and words in an RTF object?
To count words I could count spaces, but I have no idea how to count the lines...
thanks
gert
Doesn't the number of lines in an rtf file depend on the width of the display. The carriage return and line feed would normally be an end of paragraph as far as I know.
Here you go.
Check the example attached.
Searching for "\r\n" won't return a reliable result. Word wrapping depends on the space available to display the text so an rtf file when viewed on one machine with say Wordpad might have 20 lines of text and 3 paragraphs and on another have 18 lines of text. It will still have 3 paragraphs though.
Sakuya, thanks for the demo! very usefull...
hello
i,m need a code that for a line count.
for example:
line = a line count of RichText
if line == 10 then
result = Dialog.Message("Notice", line, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end