O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Starting Up with the Main Method

Each console application starts with a certain method, which in Visual Basic (and many other languages) always has the name Main, and contains statements that are encapsulated between Sub and End Sub commands (in Visual Basic only). A Sub in Visual Basic defines a method without return values. A console application needs at least this one Main method so that Windows knows where your program begins. In Visual Basic, you define methods that return values with the Function keyword and designate the return value with the Return keyword. The following section explains this in more detail.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required