Leverage the .NET Framework with Visual Basic.NET

More New Features

Returning values from Functions

The return value from a VB function is normally set by assigning it to the function name as in:

Public Function MyFunc() As Int32
  MyFunc=42
End Function

With VB.Net an alternate format is also available:

Public Function MyFunc() As Int32
  Return(42)
End Function

Initializers

Initializers allow you to specify values when variables are declared. For example:

Private mProp As Int32 = 42
Dim sTitle As String = "Default"
Dim dblRates() As Double = {5.0, 25.5, 62.7}

Constructors

A constructor on a class allows a set of values to be passed in when the class is created. This allows the class to initialize properly and eliminates the need to add code to check that required properties are set before other properties or methods are called.

Multithreading

It is possible to create multithreaded applications in VB.Net. With multithreading, for example, a long-running process can be spawned on a secondary thread while the main application thread continues to interact with the user. It is also possible to write Windows NT services natively in VB.Net rather than needing to use API calls or third-party controls.

Conclusion

The Visual Basic.NET language also provides a modernized, simplified syntax that will make developers' code more robust, scalable and flexible. One of the most important additions is object inheritance. In Visual Basic.NET, all managed types derive from System.Object. The universal type system allows for greater interoperability, also contributing to the enhanced power and flexibility found in Visual Basic.NET.

You might also like...

Comments

About the author

G.Gnana Arun Ganesh

G.Gnana Arun Ganesh India

G.Gnana Arun Ganesh is the Administrator and the Founder of ARUN MICRO SYSTEMS (www.arunmicrosystems.netfirms.com). He has been programming in C++, Visual Basic, COM, Java and Microsoft Technolo...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard