CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2010
    Location
    Washington, DC
    Posts
    11

    Code Insertion Syntax

    Novice presently using Visual Studio 2008 to complete an excercise. The first three chapters can be found at: http://www.headfirstlabs.com/books/hfcsharp/ and is downloadable as a PDF. The pertinent pages are between 50-60

    The specifics are as follows:

    MessageBox.Show("Contact List 1.0. \nWritten by: Your Name", "About"); This time the text appears in red suggesting an error. Placing the cursor over the text launches the message box "Represents text as a series of Unicode characters. I have done this successfully in the past but this time a problem exists. Seeking Guidance on what needs to be corrected.
    Attached Images Attached Images

  2. #2
    Join Date
    Jan 2009
    Posts
    596

    Re: Code Insertion Syntax

    "Represents text as a series of Unicode characters" is just describing what a String does (i.e. the arguments to MessageBox.Show)

    Does this code compile, though? If it doesn't, what error message do you get?

  3. #3
    Join Date
    Jan 2010
    Posts
    1,133

    Re: Code Insertion Syntax

    There's no error in the image you've posted: the dark red text is just how Visual Studio represents string literals (anything between " and "). If there was a compiler error, you'd recognize it for sure, as (1) the code wouldn't compile, and then (2) a red wiggly line would appear beneath the problematic code.
    But, I find it strange you didn't notice this before, if you used strings before?

  4. #4
    Join Date
    Feb 2010
    Location
    Washington, DC
    Posts
    11

    Re: Code Insertion Syntax

    Greetings and much thanks for your support. I write as a compete novice half way through the first chapter of a C# book. Would F5 harm this project if submitted prematurely?

  5. #5
    Join Date
    Jan 2009
    Posts
    596

    Re: Code Insertion Syntax

    Quote Originally Posted by philpense View Post
    Would F5 harm this project if submitted prematurely?
    If by 'F5' you mean start debugging, then no, it won't harm your project.

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