O'Reilly logo

Visual Basic Design Patterns: VB 6.0 and VB.NET by James W. Cooper

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

Chapter 8. Arrays, Files, and Exceptions in VB.Net

VB7 makes some significant changes in the ways you handle arrays and files and completely changes error handling. All of these changes make your programming a lot easier than it was before.

Arrays

In VB7, all arrays are zero based. This is actually the same as in previous versions of Basic, but it was seldom emphasized. In VB6, if you wrote the following

Dim x(10) As Single

then you assumed that the x array had elements from 1 to 10, but it actually always included a zero element as well. In other words, the x array actually had 11 elements. This remains true in VB7.

However, we can also now move through arrays to be in line with the style used in C, C++, C#, and Java.

 Dim Max as Integer Max = 10 ...

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