Before we can proceed to design the screen for our Customer program, we must consider how the cursor moves in screens where the fields are arranged in more than one column.
How the Cursor Moves in Complex Screens
QA Build assumes that fields are arranged in a gridthat is, fields are arranged in rows and columnswith field numbers allocated from left to right and top to bottom. The number of rows and columns in the map is set from the Map Properties dialog. So, in a screen with four rows and five columns, the fields would be numbered 1 to 20 as follows:
field_1 field_2 field_3 field_4 field_5
field_6 field_7 field_8 field_9 field_10
field_11 field_12 field_13 field_14 field_15
field_16 field_17 field_18 field_19 field_20
When the <¯> key is pressed, the destination field number is calculated by adding the number of columns to the current field number. So, in the above example, if the cursor is positioned on field_4, and you press <¯>, QA Build repositions the cursor on field_9, because 4 + 5 = 9. The reverse applies if the <> key is pressed. For this reason, if you incorrectly number the fields, the cursor movement routines will not work as expected. Similarly, if you incorrectly set the number of rows and columns, some fields may be inaccessible. If you leave the numbers of rows and columns at the default setting of 0, the cursor will be unable to appear in the map and the Field out of range error message will be generated when you attempt to set up the field processing.
Of course, in a practical program it is rarely possible to organise the fields in a perfect grid like the one above; the sizes of fields vary depending on the data type and other layout considerations inevitably impose constraints on the way in which they are arranged. It is still possible, however, to make the cursor move in an orderly manner when the fields are not so regularly arranged. We pretend that the ideal grid is still present and we allocate each field the number of the closest field in that hypothetical grid. This means, of course, that someand perhaps mostfield numbers are missing, as in the following example:
field_1 field_2
field_6
field_11 field_12 field_13
field_16 field_17 field_19 field_20
The cursor movement routines still work because, if the calculated destination field number is that of a missing field, the calculation is repeated until an existing field is located. For example, if you are on field_2 and press <¯>, 2 + No. Columns (5) gives 7. Field_7 does not exist. So QA Build repeats the calculation with field_7. 7 + No. Columns (5) gives 12. This field does exist, so field_12 is the next input field.
You are going to design the following data entry screen for the CUSTOMER table:

It has ten fields, including seven from the CUSTOMER table, one from the REGION table and two buttons. These are arranged in four rows and five columns. The ADDRESS field only counts as one row, even though it is three lines deep. The field numbering is the same as that in the example above; field numbers 35,710,14,15 and 1820 do not exist and are omitted.
1. Enter the map editor
2. Include the text and add the following edit controls, taking
care to specify the field numbers indicated in brackets, CUSTOMER_NUMBER (1), NAME (2),
ADDRESS (6), CREDIT_CUSTOMER (11), CREDIT_LIMIT (12), BALANCE (13), REGION_CODE (16) and
NAME (17)
Note that the NAME field occurs twice: the first occurrence for the CUSTOMER.NAME and the
second for the REGION.NAME. The respective tables are identified when you specify the
field processing
3. Add a 3D effect to each edit control by ticking the 3D box under the appearance section. Tick the clear first box for fields 2, 6, 11 and 16. Make field 6 a multi-line field. Tick the prompt option for field 16.
4. Add two buttons with field numbers 19 and 20. For the first button make the caption OK and give it an associated key press of Enter. For the second button, make the caption Cancel and give it an associated key press of Esc. Place them at the bottom of the screen.
5. Double click on the map to bring up the properties. Ensure that: the field layout is set to 4 rows and 5 columns, the border is set to thin and shadowed and the title bar box is ticked.
6. When your design is complete, save the map and leave the Map Editor. In Screen Design select Top of Screen as the output method.