\n\r in an editbox control???

This is a discussion on \n\r in an editbox control??? within the Windows Programming forums, part of the Platform Specific Boards category; I'm sending the next string to the edit control: "[b]hello\n\rworld[b]"... But the edit box displays the string without getting to ...

  1. #1
    * Death to Visual Basic * Devil Panther's Avatar
    Join Date
    Aug 2001
    Posts
    768

    \n\r in an editbox control???

    I'm sending the next string to the edit control: "[b]hello\n\rworld[b]"... But the edit box displays the string without getting to the next line, and instead of \n\r it shows 2 unknown signs, but when I made it \r\n it worked, why?

    Code:
    EDITTEXT        IDD_EDIT, 10, 35, 165, 70, ES_AUTOHSCROLL | ES_AUTOVSCROLL | WS_VSCROLL | ES_MULTILINE | ES_WANTRETURN | ES_READONLY

    Thanks
    Last edited by Devil Panther; 07-18-2003 at 04:59 AM.
    "I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe

    http://www.Bloodware.net - Developing free software for the community.

  2. #2
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,831
    Probably the compiler writer looks along the string and finds a '\n' - knowing this is not an expected valid character, it prints a splat. Then it looks at the next character and does the same.

    The other way around, it see's the '\r' and because the author knows this may be valid, does a look ahead to see if the next character is a '\n' if so, it correctly interprets your wishes.

    If the requirement is "\r\n" then that is a requirement. If you wrote this...
    Code:
    fi ( x == 6)
    ... would you expect it to work?!
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 04:42 PM
  2. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  3. Reading an EditBox control
    By Devil Panther in forum Windows Programming
    Replies: 6
    Last Post: 08-20-2005, 03:04 PM
  4. EditBox control style change
    By Devil Panther in forum Windows Programming
    Replies: 13
    Last Post: 11-13-2004, 01:54 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21