1. Home
  2. Computing & Technology
  3. Visual Basic

The Top Five Changes between VB 6 and VB.NET

By Dan Mabbutt, About.com

5 of 8

4th Place - Changes to Procedure Calls

In 4th Place, we have Changes to Procedure Calls!

This is the "goodness, purity, and wholesome virtue" award and represents a lot of hard campaigning by the "no more sloppy code" faction.

In VB6, if a procedure parameter variable is an intrinsic type, then it's ByRef, unless you have coded it ByVal explicitly, but if it's not coded ByRef or ByVal and it's not an intrinsic variable then it's ByVal. ... Got that?

In VB.NET, it's ByVal unless it's coded ByRef.

The ByVal VB.NET default, by the way, also prevents changes to parameter variables in procedures from being unintentionally propagated back into the calling code - a key part of good OOP programming.

Microsoft also "overloads" VB.NET with a change in the requirements for parentheses in procedure calls.

In VB6, parentheses are required around arguments when making function calls, but not when calling a subroutine when not using the Call statement but they are required when the Call statement is used.

In VB.NET, parentheses are always required around a nonempty argument list.

Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic
  4. Opinions and Humor
  5. The Top Five Changes between VB 6 and VB.NET

©2009 About.com, a part of The New York Times Company.

All rights reserved.