11-06-2009, 01:20 PM
What is a parallel array? Do you mean a string array for a name and a integer array for the age or something like that?
Let's go with that....
DIM Names(100)
DIM Ages(100)
So now you have two arrays that can hold 100 names and ages.
Now all you have to do is fill the array element values in the program.
1) Get the data from a user entry
2) Get data from the program using DATA field
3) Get data from a file
The array elements should match the data supplied.
So If I enter "Ted" for the name and 50 for my age, then :
PRINT Names(1) ' displays Ted
PRINT Ages(1) ' displays 50
You can create other arrays for different number types.
Let's go with that....
DIM Names(100)
DIM Ages(100)
So now you have two arrays that can hold 100 names and ages.
Now all you have to do is fill the array element values in the program.
1) Get the data from a user entry
2) Get data from the program using DATA field
3) Get data from a file
The array elements should match the data supplied.
So If I enter "Ted" for the name and 50 for my age, then :
PRINT Names(1) ' displays Ted
PRINT Ages(1) ' displays 50
You can create other arrays for different number types.
Get my QB demonstrator here: http://dl.dropbox.com/u/8440706/Q-Basics.zip