Visual Basic

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

The Top Five Changes between VB 6 and VB.NET

By Dan Mabbutt, About.com

6 of 8

3rd Place - Arrays are 0 based instead of 1 based

The Bronze Award - 3rd Place, goes to Arrays are 0 based instead of 1 based!

It's just one syntax change, but this change gets "medal podium" status because it is voted, "most likely to screw up your program logic". Remember, 3rd place IS "Award(2)" in our list. If you have counters and arrays in your VB6 program (and how many don't), this one will MESS YOU UP.

For ten years, People have been asking, "What was Microsoft smoking when they did it this way?" And for ten years, programmers have sort of universally ignored the fact that there was a myArray(0) element that just took up space and didn't get used for anything ... Except for those programmers who DID use it and their programs looked, I mean, just "weird".

For I = 1 to 5
   MyArray(I - 1) = Whatever
Next

I mean, REALLY! ...

Explore Visual Basic

By Category

About.com Special Features

Visual Basic

  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.