Rearranging the Form
Perhaps the easiest form of localization is to rearrange the order of
elements on the form. Our program form specification does not include
any element ordering information. This is controlled through the
dictionary. Thus, this localization can be accomplished by modifying the
form using FORMSPEC, changing the element sequence on the form definition
in the dictionary, and recompiling our program using TRANCOMP.
The same program could then handle input from a form such as this:
________________________________________________________________
| |
| vcustomer customer data |
| |
| |
| name [ ] number [ ]|
| |
| address [ ] |
| |
| city,state [ ] |
| |
| zipcode [ ] |
________________________________________________________________
Figure 9-4. Rearranged Customer VPLUS form
Changing the form definition in the dictionary might go something like
this:
_________________________________________________________________________________
| |
| :run dictdbm.pub.sys |
| |
| DICTIONARY/3000 HP32244A.02.01 - (C) Hewlett-Packard Co. 1984 |
| |
| PASSWORD FOR DICT.PUB> |
| |
| FORMS ENTRY(Y/N)?> |
| |
| > show file |
| FILE vcustomer |
| |
| FILE TYPE: RESPONSIBILITY: |
| VCUSTOMER FORM |
| |
| ELEMENT(ALIAS): PROPERTIES: ELEMENT(PRIMARY):|
| CUST-NO I+(4,0,2) CUST-NO |
| NAME X (20,0,20) NAME |
| STREET-ADDR X (20,0,20) STREET-ADDR |
| CITY-STATE X (20,0,20) CITY-STATE |
| ZIPCODE X (6,0,6) ZIPCODE |
| |
| > resequence file |
| FILE vcustomer |
| |
| ELEMENT name |
| NEW POSITION cust-no |
| |
| ELEMENT |
| > show file |
| FILE vcustomer |
| |
| FILE TYPE: RESPONSIBILITY: |
| VCUSTOMER FORM |
| |
| ELEMENT(ALIAS): PROPERTIES: ELEMENT(PRIMARY):|
| NAME X (20,0,20) NAME |
| CUST-NO I+(4,0,2) CUST-NO |
| STREET-ADDR X (20,0,20) STREET-ADDR |
| CITY-STATE X (20,0,20) CITY-STATE |
| ZIPCODE X (6,0,6) ZIPCODE |
_________________________________________________________________________________
Figure 9-5. Dictionary changes to specify a rearranged screen