Thread: \n\r in an editbox control???

  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 03: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,829
    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, 03: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, 02: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, 09:44 AM