ARTICLE

Placing Multiple Statements in a Single Line in VB.NET

Posted by Mahesh Chand Articles | Visual Basic Language May 04, 2010
Placing Multiple Statements in a Single Line
 
Reader Level:

Placing Multiple Statements in a Single Line

If you need to place multiple statements in a single line, you can separate statements with a colon. The code snippet in Listing 4 places three statements in a single line.

    Function MultipleStatementInSingleLine(ByVal NumberOne As Integer, _

                                     ByVal NumberTwo As Integer) As Integer

        Dim total As Integer = NumberOne + NumberTwo : Dim difference = NumberOne - NumberTwo : Return total

 

    End Function 

Listing 4

share this article :
post comment
 
Nevron Diagram
Become a Sponsor
PREMIUM SPONSORS
  • The leading .NET charting control now features PDF, Flash and Silverlight export, visualization of large datasets and more. Deliver true charting functionality to your BI, Scorecard, Presentation or Scientific apps. Download evaluation now.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Nevron Diagram
Become a Sponsor