CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    156

    How to concatenate long string in source code

    Hi,

    I have some MessageBox with several lines of message string. If I put them on the same line in the source file they are OK but it is a pain to scroll all the way to the right just to change or see the whole message.

    Is there a concatenating symbol I can use so that I may have something like:
    MessageBox(NULL, "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n
    bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n
    cccccccccccccccccccccccccccccccccccccccc",
    "Error Message", MB_ICONSTOP);

    I have look in the help but could not find it. Anyone has any idea? thanks.


    Will


  2. #2
    Join Date
    May 1999
    Location
    Texas, USA
    Posts
    568

    Re: How to concatenate long string in source code

    You don't see this to often in books but all you have to do is seperate them with quotation marks, like this.

    MessageBox(NULL, "AAAAAAAAAAA"
    "BBBBBBBBBBB"
    "CCCCCCCCCCC"
    "DDDDDDDDDDD", NULL, MB_OK);



    The compiler automatically concatenates them.

    Wayne



Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured