Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Nov 2004
    Location
    Belgium, Leuven
    Posts
    145

    count lines in RTF object

    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

  2. #2
    Join Date
    Aug 2003
    Posts
    2,427
    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.

  3. #3
    Join Date
    Oct 2009
    Location
    Merton, United Kingdom
    Posts
    684
    Here you go.

    Check the example attached.
    Attached Files

  4. #4
    Join Date
    Aug 2003
    Posts
    2,427
    Quote Originally Posted by Sakuya View Post
    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.

  5. #5
    Join Date
    Nov 2004
    Location
    Belgium, Leuven
    Posts
    145
    Sakuya, thanks for the demo! very usefull...

  6. #6
    Join Date
    Feb 2010
    Posts
    35
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts