This chapter discusses the fundamentals of any programming language: variables and procedures. A variable stores data, and a procedure is code that manipulates variables. To do any serious programming with Visual Basic, you must be familiar with these concepts. To write efficient applications, you need a basic understanding some fundamental topics, such as the types, scope, and lifetime of variables, and the procedures and argument-passing mechanisms.
As you have seen in the first two chapters, most of the code in a Visual Basic application deals with manipulating control properties. This chapter explores in greater depth how variables store data and how programs process variables. If you’re familiar with Visual Basic, you might want to simply scan the following pages and make sure you’re acquainted with the topics and the sample code dis- cussed in this chapter.
If you’re new to Visual Basic, you may find that some material in this chapter is over your head. This chapter covers basic concepts and definitions-in general, tedious, but necessary, material. You’ll also learn how to use variants and how to write functions with optional arguments. Think of this chapter as a prerequisite for the more advanced techniques covered in the rest of the book.