CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Question Line Continuation Character in VB

    Hello everyone, it is an honour to meet you!

    I should congratulate you on an excellent VS 2010 product!

    Just curious here. Why has it taken so long to get rid of VB's Line Continuation character - the "underscore" ?. Also, I have heared that certain with statements, the underscore is still needed, is this true?

  2. #2
    Join Date
    Jun 2010
    Posts
    6

    Re: Line Continuation Character in VB

    Hi HanneSThEGreaT,

    There was a significant amount of work that needed to be done to remove the line continuation character. Before, <CrLf> was the line terminator in VB (just like the semi-colon is the line terminator in C#) but now there is NO line terminator in VB (I believe this is the only language without a line terminator now). This means that there is come significant (and cool ;-)) logic in the VB compiler that looks at the meaning of your code to determine where the terminator should be. Removing the requirement for the underscore comes in especially handy when writing LINQ statements.

    Check out this Channel 9 video with Tyler Whitney, a developer on the Visual Basic compiler team: http://channel9.msdn.com/posts/funky...sual-Basic-10/

    There are still places where the compiler cannot infer the meaning of your code if you insert a break prematurely (as Tyler explaines) but you get a compiler error immediately (thanks to VB's background compiler) which helps you realize immediately that you either need an underscore or need to put the break elsewhere.

    HTH,
    -Beth

  3. #3
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: Line Continuation Character in VB

    Hi Beth,

    Thank you for clearing that up

    Hannes

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