You can define arrays of variable fields in a map to make it easier to work with several related fields at the same time.
To define an array, you first specify the array's physical arrangement on the map and give the array a name.
You need to define four arrays for your sample program. These four map arrays are arranged in four columns named CUSNUM-A, CUSNAME-A, CUSCONTACT-A, and CUSPHONE-A.
Turn on the grid, select View>Grid, to help you locate lines and columns referenced in the following tasks. If you want to look at array indices, select Define>Field Edit Order>Show Tags. Both of these features can be turned off by repeating the menu selections you used to turn them on.
To define the first map array:
Figure 60. Array Tab on the Variable Field Properties Window
Figure 61. General Tab on the Variable Field Properties Window
On the General tab, you specify the name of the array variable for the map array. You can also specify an array index. Each variable field in the map array is assigned a subscripted name, starting with this index. For instance, if you specify SSN as the name and 1 as the starting index, the variable names assigned are SSN(1), SSN(2), SSN(3), and so on.
If the map array you are defining has multiple rows and columns, you can use the Naming Direction selections on the Array tab to choose the direction used first in assigning names to the variable fields. Because you are defining an array with only one column in this exercise (1 is the default value in the Fields across field), the naming direction is not important.
Now define three more arrays using these same steps and the names and
values in the following table.
Start column | Fields down | Array name | Length |
---|---|---|---|
13 | 5 | cusname-a | 20 |
37 | 5 | cuscontact-a | 20 |
61 | 5 | cusphone-a | 12 |
Your map should look like the one shown in Figure 62.