Phone directories are everywhere, and with the advent of cell phones with auto-dial, it's harder than ever to keep track of people's numbers. Seriously, when was the last time you actually dialed your friend's number? There's got to be a better way, right?
There is. In this lab, we're going to keep track of names and numbers in a type of data structure called a parallel array. There will be two dynamic arrays, one for the names and one for the numbers. The indicies of each array will match. So the name in strName(3) goes with the number in strNumber(3).
You'll need a Form, a ListBox to display the array, two TextBoxes (one for name and one for number), and three Buttons: Add, Find, and Delete.
When a Button is clicked, the action that the program takes is determined by the Button clicked:
HINTS: Use a string for the numbers as well as the names, so you can use characters like () and - in your phone numbers. Remember that the indicies in each array match, so you can reuse the index or size from one in the other.
It wouldn't hurt to have an "are you sure" MsgBox pop up first. When the second (usually blank) argumet of a MsgBox call is 1, then the box that pops up has two buttons: OK and Cancel. The MsgBox function returns 1 when you click OK and 2 when you click Cancel.
As always, design a useful and proper interface, including tab order and access keys.