Visual Basic 2008 Programming: Business Applications with a Design Perspective
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Appendix A Appendix B Appendix C Home
Loading
Last change: February 13 2016 18:48:19.

 Chapter in PDF

Table of Contents

Chapter 8: Arrays and Their Uses
Last change: February 13 2016 18:48:01.
Next>>

Chapter 8
Arrays and Their Uses

So far, most of the variables you have used have been scalar variables. That is, each of these variables holds one value, a number, or a string. There may be times when you will encounter a situation in which your program needs to handle a large group of homogeneous data, and it needs to access these data back and forth. In this case, using array variables will be more elegant and/or efficient. An array is a collection of more than one element of data, and is collectively recognized by the same variable name. Each element in the array is indexed with the variable’s subscript(s). You can refer to these elements by their indexes.
Although the concept of arrays appears simple, their applications can be fascinating. Their uses can make many complex problems much easier to solve. One interesting problem is sorting, which involves arranging data in order. The goal is simple and well defined, but the algorithms to solving the problem are diverse and intriguing.
An array can have one or more subscripts. The number of subscripts of an array is also referred to as the rank or the number of dimensions; for example, an array with two subscripts is recognized as a two-dimensional array. Although most of this chapter is devoted to discussing uses of one-dimensional arrays, the last section deals with two-dimensional arrays.
After completing this chapter, you should be able to:

Last change: February 13 2016 18:48:01.
Next>>