Thread: return syntax

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    return syntax

    I am very new to C++

    I am trying to get text to print as follows:

    Sentence One.

    Sentence Two.

    Sentence Three.

    Sentence Four.

    Sentence Five.



    Everything prints fine until i try to add the "\r\n\r\n" into my statement. Then it cuts off text from the last sentences... any help would be appreciated. My sentence is as follows... thanks:

    Code:
    pDBView->Set_Field((CString)"Sentence one. \r\n\r\n Sentence Two. \r\n\r\n Sentence Three.  \r\n\r\n Sentence Four.  \r\n\r\n Sentence Five", TAG_VALUE, lRecord, ENTITY_INFORMATION);
    Last edited by Beaner; 03-24-2005 at 08:56 AM.

  2. #2
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Show us your code using code tags.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    My guess is that windows control doesn't do newlines.
    It might on the other hand put each request onto separate lines
    Code:
    pDBView->Set_Field((CString)"Sentence one");
    pDBView->Set_Field((CString)"Sentence two");
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Mar 2005
    Posts
    15

    Thanks!

    Salem,

    Thank you! I did that and everything worked for me. Thanks again for the help!

    Beaner

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New string functions
    By Elysia in forum C Programming
    Replies: 11
    Last Post: 03-28-2009, 05:03 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Using VC Toolkit 2003
    By Noobwaker in forum Windows Programming
    Replies: 8
    Last Post: 03-13-2006, 07:33 AM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM