Skip to content

Commit 88c552f

Browse files
paul1956KathleenDollard
authored andcommitted
Add support for Comments after Line Continuations new in VB 16. (dotnet#14247)
* Add support for Comments after Line Continuations new in VB 16. * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update docs/visual-basic/programming-guide/program-structure/how-to-break-and-combine-statements-in-code.md Co-Authored-By: Ron Petrusha <ronpet@microsoft.com> * Update whats-new.md * Update docs/visual-basic/getting-started/whats-new.md Co-Authored-By: Kathleen Dollard <kathleen.dollard@microsoft.com>
1 parent 3fd35d0 commit 88c552f

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

docs/visual-basic/getting-started/whats-new.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@ This topic lists key feature names for each version of Visual Basic, with detail
1515

1616
## Current version
1717

18-
Visual Basic 15.8 / Visual Studio 2017 Version 15.8
19-
For new features, see [Visual Basic 15.8](#visual-basic-158)
18+
Visual Basic 16.0 / Visual Studio 2019 Version 16.0
19+
For new features, see [Visual Basic 16.0](#visual-basic-160)
2020

2121
## Previous versions
2222

23+
Visual Basic 15.8 / Visual Studio 2017 Version 15.8
24+
For new features, see [Visual Basic 15.8](#visual-basic-158)
25+
2326
Visual Basic 15.5 / Visual Studio 2017 Version 15.5
2427
For new features, see [Visual Basic 15.5](#visual-basic-155)
2528

@@ -53,6 +56,22 @@ Bit-shift operators, loop variable declaration
5356
Visual Basic / Visual Studio .NET 2002
5457
The first release of Visual Basic .NET
5558

59+
## Visual Basic 16.0
60+
Visual Basic 16.0 focuses on supplying more of the features of the Visual Basic Runtime (microsoft.visualbasic.dll) to .NET Core and is the first version of Visual Basic focused on .NET Core. Many portions of the Visual Basic Runtime depend on WinForms and these will be added in a later version of Visual Basic.
61+
62+
**Comments allowed in more places within statements**
63+
In Visual Basic 15.8 and earlier versions, comments are only allowed on blank lines, at the end of a statement, or in specific places within a statement where an implicit line continuation is allowed. Starting with Visual Basic 16.0, comments are also allowed after explicit line continuations and within a statement on a line beginning with a space followed by an underscore.
64+
65+
```vb
66+
Public Sub Main()
67+
cmd.CommandText = ' Comment is allowed here without _
68+
"SELECT * FROM Titles JOIN Publishers " _ ' This is a comment
69+
& "ON Publishers.PubId = Titles.PubID " _
70+
_ ' This is a comment on a line without code
71+
& "WHERE Publishers.State = 'CA'"
72+
End Sub
73+
```
74+
5675
## Visual Basic 15.8
5776

5877
**Optimized floating-point to integer conversion**

docs/visual-basic/programming-guide/program-structure/how-to-break-and-combine-statements-in-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ When writing your code, you might at times create lengthy statements that necess
2727

2828
### To break a single statement into multiple lines
2929

30-
- Use the line-continuation character, which is an underscore (`_`), at the point at which you want the line to break. The underscore must be immediately preceded by a space and immediately followed by a line terminator (carriage return).
30+
- Use the line-continuation character, which is an underscore (`_`), at the point at which you want the line to break. The underscore must be immediately preceded by a space and immediately followed by a line terminator (carriage return) or (starting with version 16.0) a comment followed by a carriage return.
3131

3232
> [!NOTE]
3333
> In some cases, if you omit the line-continuation character, the Visual Basic compiler will implicitly continue the statement on the next line of code. For a list of syntax elements for which you can omit the line-continuation character, see "Implicit Line Continuation" in [Statements](../../../visual-basic/programming-guide/language-features/statements.md).

0 commit comments

Comments
 (0)