Monday, 3 September 2012

Continuing VB.Net statements over multiple lines

In older versions of VB.Net (prior to VB2010 I think), you were required to use the line continuation character (the underscore "_") whenever you split a statement over multiple lines.

From VB2010 you can omit this character in a large number of cases.

For a complete list of cases where you can omit this (annoying) character, search the help for "statements in visual basic" and then scroll down to the section entitled "Continuing a Statement over Multiple Lines". This contains a sub-section entitled "Implicit Line Continuation" which lists "the syntax elements that implicitly continue the statement on the next line of code."