filePro has a number of ways to control data input. One of the first ways to do this that is still in use is by using edits.
What is an edit? Simply put, an edit puts constraints on how you can put data into your program. So, when the user fills out a field, it forces the input to conform to a standard defined for your specific application.
What does this mean in practice? It means that, for example, dates must be valid, phone numbers must have a certain format, and numbers-only fields can only contain, well, numbers. It means that some fields are required while others are not, and you can’t save the entry if the required fields are empty. It also means that the data is displayed in a certain way (e.g., left justified), depending on the way your screens are set up.
FilePro includes a number of built-in edits, such as:
- YESNO: only allow yes (Y/y) or no (N/n) responses
- ALLUP: display the input in all capital letters (even if it’s entered in a different way)
- NUM: only numeric values allowed
A programmer can create as many custom edits as desired on top of the large dictionary of built-in edits.
Why use edits? Why even go through the trouble of setting up these rules for data entry? Without these constraints, your users are not guaranteed to enter data in the way you want.
Let’s consider an example. Your employees take orders from customers, and they have to input the time that the order occurred. Without a defined edit, an employee could enter anything. Five different employees who try to enter “2 pm” for orders entered at 2 pm could result in the following five entries:
The first 3 entries are valid, the fourth entry somewhat conveys the correct information but not in the correct numerical format, and the final entry was a mistake.
Searching and sorting this data is a nightmare. If you try to print a report of all orders made at 2 pm with this data, most of the data would not be found. If you had defined an edit to require a time to be input as “00:00” in 24 hour time, then only the 14:00 entry would be allowed for all of the employees, and you would easily be able to search and sort based on the order time.
What happens if a user tries to enter data in a way that’s not allowed? An error message will be displayed with “Edit Failed At Cursor Position.” This is a cryptic message if you don’t know what an edit is, this message probably isn’t very helpful.
Say the user is trying to put a name in the field labeled “Time”. They would see the default error message.
Entering the time as 24-hour time in the format XX:XX:XX lets the user continue to enter data.
This is the default error message, but a programmer can choose to make this message more helpful. So, in the example above, it may say “Invalid time. Please enter a time in the format XX:XX:XX without am or pm.”
A programmer can speed up data entry for users if the possible options for the field are limited. For example:
- An employee has to select his/her name from a list of salespeople when entering an order.
- An employee has to choose a city name corresponding to their store location when entering a purchase order.
Consider the first situation: an employee enters an order and has to enter their name. The programmer could implement a shortcut in which the employee enters their employee number instead of their name. So, “Tom Jones” becomes “1”, “Sally Smith” becomes “2”, and “Richard Harris” becomes “3”.
This isn’t necessarily the best option. It’s very inflexible, and the user needs to have the number memorized. This burden is lessened by adding a help line at the bottom of the screen, but this only works if the number of options is very small. Furthermore, the programmer has to edit the list of options every time an employee is added or removed.
A better option called a “Browse Window” was added to filePro in the 1990s. This method allows the programmer to create modifiable list of allowable options. So, the programmer sets up the structure of the edit, but users can add or delete members of the list.
Consider the latter data entry example above, in which the store location must be specified. A browse window will pull up a list of possible cities. The employee can type part of the city, and pressing ENTER will bring up the window. Pressing ENTER again on the correct option will fill in the field with the data. Cities can be added or removed as needed. With this option, data entry is more flexible and a programmer not needed for every change to the list of options.