VB.NET 1.1 Tutorial - The Sub Keyword


The Sub keyword is used to declare a subroutine (a method that has no return value). The access modifier is defaulted to Public, but can be changed to any of the listed modifiers. A Subroutine is declared in the following manner:

Sub MySub()
  ' ...
End Sub 

The subroutine can take arguments and have multiple exit points. For more details follow the link in the references below. The Subroutine always finishes with the End keyword.


References

For more information on the Sub Statement, visit MSDN at microsoft here.

What Next?

Return to the Tutorial Contents.