Is there a way to have a statement across multiple lines without the underscore character?
It is really annoying in multi-line strings such as SQL statements, and es
No, the underscore is the only continuation character. Personally I prefer the occasional use of a continuation character to being forced to use it always as in C#, but apart from the comments issue (which I'd agree is sometimes annoying), getting things to line up is not an issue.
With VS2008 at any rate, just select the second and following lines, hit the tab key several times, and it moves the whole lot across.
If it goes a tiny bit too far, you can delete the excess space a character at a time. It's a little fiddly, but it stays put once it's saved.
On the rare cases where this isn't good enough, I sometimes use the following technique to get it all to line up:
dim results as String = ""
results += "from a in articles "
results += "where a.articleID = 4 " 'and now you can add comments
results += "select a.articleName"
It's not perfect, and I know those that prefer C# will be tut-tutting, but there it is. It's a style choice, but I still prefer it to endless semi-colons.
Now I'm just waiting for someone to tell me I should have used a StringBuilder ;-)
No, you have to use the underscore, but I believe that VB.NET 10 will allow multiple lines w/o the underscore, only requiring if it can't figure out where the end should be.