Chapter 16. Visual Basic 2005 Fundamentals

One goal of this book is for you to pick up the language fundamentals of Visual Basic 2005 as you create applications. Thus, Chapter 1 starts right off with building applications and eschews the traditional introduction to programming elements such as If statements, While loops, and so forth.

That said, Visual Basic 2005 is a full programming language with its own complexities. This chapter is aimed at readers who would like to get the fundamentals under their belt before reading the rest of the book (feel free to read this chapter first), or readers who want to review the fundamentals after reading the book, as well as readers who want to dip in now and then, to check how certain things are done as they read the book.

While this book is aimed at VB6 programmers making the transition to .NET, this chapter does not assume prior experience with Visual Basic or any other programming language, though if you've never programmed at all you may find the pace a bit quick.

Types

Every object in Visual Basic 2005 has a type. Types come in two flavors:

  • Those that are built into the language (called fundamental or intrinsic types )

  • Types you create (classes, structs, and interfaces)

Visual Basic 2005 offers a number of intrinsic types , as shown in Table 16-1.

Table 16-1. The intrinsic types

Type

Size (in bytes)

.NET type

Description

Boolean

1

Boolean

true or false.

Byte

1

Byte

Unsigned (values 0-255).

Char

2

Char

Unicode characters. ...

Get Programming Visual Basic 2005 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.