return syntax

This is a discussion on return syntax within the Windows Programming forums, part of the Platform Specific Boards category; I am very new to C++ I am trying to get text to print as follows: Sentence One. Sentence Two. ...

  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
    32,855
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 06:03 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 02:01 AM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 02: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, 05:10 AM

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