7.13. The Bottom Line

Understand what arrays are and what you use them for. Arrays play an important role in computer programming. In some ways they resemble a mini-database, and organized data is central to computing. Computers are sometimes called data processors for good reason, and arrays make it easier for you to manipulate variable data.

Master It What is the difference between an array and an ordinary variable?

Create and use arrays. When you create a new array, you declare it and, optionally, specify the number of values it will contain.

Master It There are four keywords that can be used to declare arrays. Name at least three of them.

Redimension an array. If you want to resize an existing dynamic array, you can redimension it.

Master It Redimensioning an array with the ReDim statement causes you to lose any values that are currently in that array. However, you can preserve these values using a special keyword. What is it?

Erase an array. You can erase all the values in a fixed-size array, or completely erase a dynamic array.

Master It Write a line of code that erases an array named arrMyArray.

Find out whether a variable is an array. An array is a type of variable, and you may occasionally need to check whether a particular variable name denotes an array or an ordinary scalar variable (a variable that isn't an array).

Master It Which built-in function can you use in VBA to find out whether a variable is an array or an ordinary, single-value variable?

Sort an array. Visual Basic .NET includes array objects with built-in search and sort methods. In VBA, however, you must write a bit of code to search and sort the values in an array.

Master It Name a popular, understandable, but relatively inefficient sorting technique.

Search an array. Searching through an array can be accomplished in two primary ways. If you have a relatively small array, you can use the simpler, but less efficient, technique. With large amounts of data, though, it's best to use the more robust approach.

Master It Name two common ways to search an array.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.170.75