Chapter 1. Mastering the Basics of Visual Basic

In This Chapter

Containing your code in classes, structures, and modules

Establishing home base with source files

Dealing with events via sub-procedures

Making efficient statements

Handling changeable values with variables

Specifying data types

Writing usable strings

Using the right operators for the job

Specifying tasks with assignment statements

This chapter outlines some basic elements of Visual Basic programming. Here you get a grip on the basic structure of Visual Basic programs and the most efficient ways to code elements such as classes, modules, Sub and Function routines, variables, and statements.

Hang on and have fun!

Looking at Classes, Structures, and Modules

Visual Basic is, frankly, a strange beast. It has evolved over many decades from a once-simple programming language known as BASIC. BASIC was invented back in 1963 at Dartmouth College as a way to teach computer programming to students who were not Computer Science majors. Of course, BASIC has changed dramatically over the years, and Visual Basic today bears almost no resemblance to the original 1963 version of BASIC. Even so, there are many elements of today’s Visual Basic that have their roots in early versions of BASIC.

In Visual Basic .NET (which I refer to as VB.NET from now on), there are three basic “containers” for your code:

  • Classes: These are the most commonly used coding elements in ASP.NET applications. Every page in an ASP.NET application is defined as a class. ...

Get ASP.NET 2.0 All-In-One Desk Reference For Dummies® 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.