Revising the structure of a filePro Plus file is easy even after data is on file. Let’s revise our customer file to add new fields and use “field type edits”.
1. Select option "1 - Define Files" from the main Menu. Highlight or type in the filename "cust" and press <RETURN>.
2. Press <RETURN> again at the creation password prompt.
3. With the "Define Files" screen displayed, press <U> for update mode. Press <RETURN> twice. The cursor is now in the field “Type” entry area. Here is where you enter the field “edits”. It’s simple to change or add a “field edit”.
4. Edits are like “filters” that can prevent unwanted information from being entered into fields. Edits can also automatically reformat information you enter. filePro Plus has many built-in edits to choose from. For example, the “phone” edit, when assigned to a field, takes the numbers “9147692150” and automatically reformats them to be “(914) 769-2150”. In the Define Edits program, which you will see later on, you can go beyond the built-in edits and create your own. For field 1, we will leave the “Type” blank. Having no edit type allows any kind of characters to be entered in the field during data-entry.
5. Use your down arrow key to move to the next line and type “uplow” (without the quotes) or press <F6> for a list of edits and select the type that way. The “uplow” edit converts the first character of each word entered to uppercase.
6. While you’re on this line, use your left arrow key to move to the field length (“Len”) column and change the “10” to “15”. Just type "15" and use the space bar to delete the extra “0”.
7. Now you’re back in the field “Type” area for field 2. Use your down arrow key to move to the next line. Again, type "uplow".
8. Move left to the “Len” area and change it to “15”.
9. Let’s add four more fields to this file. If you are still in the field “Type” area for field 3, press <RETURN> to go to field 4. While In the “Field Heading” area, type "address" and press <RETURN>.
Figure 5-1. Define Files Screen with “Cust” File Structure
10. For field length, type "25".
11. For the field edit, type "allup". This type (edit) converts all characters to uppercase.
12. Define four more fields (5 through 8) using the information provided in Figure 5-1.
Note: There are many automatic edits provided by filePro Plus for field types. We have already discussed the uplow, allup, and phone edits. The “state” edit makes certain that the 2 characters entered conform with postal abbreviations. “Zip” makes certain that 5 or 9 numbers are entered, and if 9 number zip codes are used, filePro Plus supplies the hyphen (-). Notice that the length we used for the zip code field was 10 to accommodate the nine digits and the hyphen.
Numeric fields (like field 8) are specified to filePro Plus by using edits consisting of a decimal point followed by the number of places that are to be maintained to the right of the decimal point.
NOTE: When specifying the length of a field with a numeric field type, be sure to allow a space for the decimal point. For example, to represent a number as high as “99.99” requires a field length of 5 instead of 4. The “.2” field edit ensures that:
. you cannot type any non-numeric characters in this field
. if you type a whole number, “.00” will be added to it
. if you type a number with more than two decimal places, it will be rounded off to two places
The complete set of supplied edits can be found in the fPmanual or by pressing <F6> when the cursor is in the “type” field.
13. Save the file structure by pressing <ESC>. Press <X> to exit.
14. At the “Screen 0” prompt, press <Y>.
15. At the “Default Report” prompt, press <Y>.
16. At the “Qualifiers” prompt, press <RETURN>.
NOTE: You will not see an “Automatic Indexes” prompt because data has already been added to the file. You can always add or change an index, by using choice “C - Index Maintenance", from the filePro Plus main menu.