The tutorial database is almost complete. You have all the files, screens, reports, and processing. What remains is to make all these separate pieces accessible to the database user. What we need now is a user menu, a central “location” where the user can select the various files, reports, and miscellaneous functions needed for database operations. We have supplied a menu called “tmenu” and a submenu called “output”.
1. From the main menu, select option “6 — Define User Menus”. For the menu name, select or type:
tmenu
For the menu heading, we have used “Tutorial Main Menu”.
For the version number, we used “01.00.00”. Press <ESC>.
You will then see the following screen:

Figure 27—1. Define User Menus Screen for menu, “tmenu”
Each element is divided into four areas for defining the menu option. These areas are “CHOICE”, “DESCRIPTION”, “ACTION”, and “LONG DESCRIPTION”. When the cursor is in one of these areas the name of the area is shown in the upper left corner of the screen:
|
|
ENTRY AREA NAME |
You type |
|
|
CHOICE |
The character to press to select the option |
|
|
|
|
|
|
DESCRIPTION |
The name of the menu option |
|
|
ACTION |
The operating system command line Instructions OR batch file instructions to execute the option |
|
|
LONG DESCRIPTION |
An additional (optional) description of the menu option, up to 75 characters long; this will appear at bottom of the menu screen whenever the menu option is highlighted by the user). |
Table 27-1. Define User Menu Elements — Entry Areas
2. This screen is where you create the user menu. Each numbered “element” will contain all the text and commands for selecting and executing one menu option. The commands entered here will have the same effect as if the user had entered them at the operating system command line.
3. If the single ACTION line is not adequate for the commands you want to use for a menu option, you can put them in a batch (DOS) or script (UNIX/ XENIX) file, instead. You can do this by putting the cursor anywhere within the element and pressing <F5> to create a batch file. A special screen for typing in the batch file will appear. As a convenience, any characters you may have already typed in the ACTION line will become the first line of the batch file.
Notice that the first element has been left blank. Let’s enter the commands to create element 1 so that the end user can access our “invoice” file. With the cursor in the “choice” area for element 1, press <I>. This tells the menu that the action line of choice one will be executed when the user presses an “I”. The cursor has moved to the description area. Type:
Invoice File
and press <RETURN>. The cursor is now in the action area. Here, we spec-ify the name of the program we wish to execute; we also supply answers and flags to customize this execution of the program.
We want to execute the Inquire, Update, Add function of filePro Plus. So, type in:
/fp/dccerk invc -S1 -h “Invoice File” and press <RETURN>.
Now the cursor is positioned in the “long description” area.
Type:
Create, View, Modify and Delete Customer Invoices and press <RETURN>.
Check what you have typed against the listing on page 27-4. When you are satisfied, press <ESC> to save the menu. Press <RETURN> (same as “N”) to the “Change Menu Password” and “Hardcopy Menu” prompts.
Figure 27—2. Menu, “tmenu”
4. On the following page is a list of the descriptions and commands we used to create the user menu, and submenu for the tutorial database.
Notice the seventh element. It will be calling a second (“sub”) menu called “output”. We will look at this “output” menu next. Return to the “Define User Menus” choice and choose the menu named “output”.
1 --------------------------------------------------------------------------------------------------------------------------
1 Invoice File
/fp/dclerk invc —si —h “Invoice File”
Create, View, Modify and Delete Customer Invoices
2 --------------------------------------------------------------------------------------------------------------------------
2 Customer File 4
/fp/dclerk cust —si —h “Customer File”
Create, View, Modify and Delete Customer Records
3 --------------------------------------------------------------------------------------------------------------------------
P P4 Product File
/fp/dclerk prod —s0 —h “Product File”
Create, View, Modify and Delete Product Records
4 --------------------------------------------------------------------------------------------------------------------------
T. State Tax Rate File
/fp/dclerk sttax —so —h “State Tax Rate File”
Create, View, Modify and Delete State Tax Rates
5 --------------------------------------------------------------------------------------------------------------------------
S State Abbreviation File
/fp/dclerk states —sO —h “State Abbreviation File”
Create, View, Modify and Delete State Abbreviations
6 --------------------------------------------------------------------------------------------------------------------------
0 Output Menu
p output
Print Invoices, Reports and Labels
7 --------------------------------------------------------------------------------------------------------------------------
8 --------------------------------------------------------------------------------------------------------------------------
A Invoicing with any # of lines
\fp\dclerk xinv —sl —h “Invoicing with any # of line items”
Example of invoicing with any number of line items per invoice
The "Output" sub-menu.
Figure 27—3. Submenu, “output”
1 --------------------------------------------------------------------------------------------------------------------------
1 Print New Invoices
/fp/dreport invc -f invoice -s new -h ‘Print New Invoices”
2 --------------------------------------------------------------------------------------------------------------------------
2 All Invoices by Customer Number
/fp/dreport invc -f invoice - ib -h “Invoices by Customer Number
3 --------------------------------------------------------------------------------------------------------------------------
3 Customer Report by Name
/fp/dreport cust -f report -a -h “Customer Report by Name”
------------------------------------------------------------------------------------------------------------------------
4 Customer Report by Number
/fp/dreport cust -f report -ib -h “Customer Report by Number”
------------------------------------------------------------------
5. Customer Mailing Labels
/fp/dreport cust —f label -a -h “Customer Mailing Labels”
6 --------------------------------------------------------------------------------------------------------------------------
6. Inventory Report
/fp/dreport prod -f report -a - h “Inventory Report” -x
7 --------------------------------------------------------------------------------------------------------------------------
7. Inventory Report to the Screen
/fp/dreport prod -f report -a -h “Invy Rpt to the Scr” -pv
8 --------------------------------------------------------------------------------------------------------------------------
8 State Code Listing
/fp/dreport states -f default -a -h “State Code Listing”
9 --------------------------------------------------------------------------------------------------------------------------
9 State Tax Listing
/fp/dreport sttax -f default -a -h “State Tax Listing”
10 --------------------------------------------------------------------------------------------------------------------------
A Product/Invoice Cross-reference
/fp/dreport invc -f xref -a -h “Product/Invoice Cross-reference
The syntax for commands on the action line starts with the path name of the program you wish to run. Next comes the name for the file, followed by (optional) format names headings, and flags.
You may call filePro Plus and non-filePro Plus programs from any menu you create. Under both DOS and UNIX/XENIX you can use the path “/fp/ programname” to access the filePro Plus programs.
Please note the slash can be used to call filePro Plus programs on both DOS and UNIX/XENIX computers.
There are many flags available, and they provide a wide range of control over filePro Plus operations. See your Quick Reference Guide. A list of filePro Plus functions and associated program names follow:
|
|
FUNCTION |
PROGRAM NAME |
|
|
|
|
|
Runtime: |
|
|
|
|
FilePro Plus Directory |
Dprodir or ddir |
|
|
Expand Files |
Dexpand |
|
|
Inquire, Update, Add |
Dclerk |
|
|
Index Maintenance |
dxmaint |
|
|
Request Output |
dreport |
|
|
|
|
|
Creation: |
|
|
|
|
Define Files |
ddeflne |
|
|
Define Screens |
dscreen |
|
|
Define Output |
dmoedef |
|
|
Define Edits |
deddef |
|
|
Define Processing |
dcabe |
|
|
Define User Menus |
dmakemen |
|
|
Printer Maintenance |
pmaint |
|
|
Run a User Menu |
p |
|
|
|
|
Table 27—2. Function/Program Names
NOTE: All the above programs except “p” are preceded by “/fp/” when used on an action line.
On the following page is a description of each element in the Tutorial Main Menu (tmenu) and the Tutorial Submenu (output).
Menu, “tmenu”
|
Element 1 |
is executed if and when the user presses <I>. It tells filePro Plus to load the Inquire, Update, Add program, select file “invc” and screen 1. The user will see the Inquire, Update, Add menu. On the action line of element 1 is: “/fp/dclerk invc -s1”. “/fp/dclerk” is the name of the Inquire, Update, Add program. “invc” is the file name of our invoice file. The “-s” flag means that what follows is a screen name; the “1” is the screen name. The —h “Invoice File” part of the command tells filePro Plus to use the heading “Invoice File” instead of the normal “Inquire, Update, Add” heading. |
|
Element 2 |
This has the same effect as element 1, except the file name is "cust". |
|
Element 3 |
Same as above, but the file name is “prod” and the screen name is "0". |
|
Element 4 |
Same as above, but the file name is “sttax” and the screen name is “0”. |
|
Element 5 |
Same as above, but the file name is “states” and the screen name is “0”. |
|
Element 6 |
case, the submenu is used for generating various kinds of output. The syntax to call a submenu is as follows: |
|
|
P menuname |
|
|
In our example the submenu is called “output”. |
|
Element 7 |
Empty. |
|
Element 8 |
This menu option is used to access transaction processing described in Lesson 29, “Transaction Processing.” |
|
|
|
Submenu, “output”
|
Element 1 |
This option prints out new customer invoices, that is, in-voices that have never been printed before. “dreport” is the name of the Request Output program. The file is “invc”. The “—f’ means what follows is a format name; the format name is “invoice”. The “—s” means that only invoices that pass the selection set “new” will be printed. |
|
Element 2 |
This option prints a report containing all the invoice records. In this case, the index to use is “b”, which is built on the “customer number” field. |
|
Element 3 |
This option prints a customer report by name. The “-a” flag specifies that all records are to be selected and the sort criteria specified when the report was created is to be used. In this case, the sort is by last name, then first name. |
|
Element 4 |
This option prints a report of customer records in the order specified by index “b”. The “-ib” flag specifies that index “b” is to be used. Since index “b” on the “cust” file is built on customer number, that is the order in which the report will be printed. |
|
Element 5 |
This option prints out the customer mailing labels (format, “label”). Once again, the “-a” flag selects all records and uses the default sort criteria. |
|
Element 6 |
This option prints a report containing all of the product re-cords. The “-a” flag tells filePro Plus to select all records. The “-x” flag tells filePro Plus to stop at the sort criteria screen and allow the user to override them. |
|
Element 7 |
This option prints the same report as element 6 except that the results are displayed on the screen instead of on the printer. The “-pv” flag is what tells filePro Plus to send the output back to the video screen. |
|
Element 8 |
This option prints the default report for the “states” file. The “-a” flag tells filePro Plus to select all records. |
|
Element 9 |
This option prints the default report for the “sttax” file. |
|
Element 10 |
This option prints a cross-reference listing of the products sold and which invoice and customer they were sold to. It illustrates one of the uses of associated fields and associated field groups. The report name is called “xref”. |
5. NOTES: If you wanted to print a selection of records instead of all records, you could, in the "Inquire, Update, Add " or "Request Output" programs, define a “selection set” for retrieving records according to field contents and logical relationships. You can save the selection set under a name, and use the name in a menu action line. The selection set will retrieve records for the report. Three other flags of particular interest are the “-P filename”, “-PT” and “-PV” flags. The “-P filename” flag tells filePro Plus to send the printed output to the file “filename”. On UNIX/XENIX computers be sure that “filename” specifies a path to which any user can write. The “-PT” flag is used for UNIX/XENIX computers only, it tells filePro Plus to send the printed output back to the terminal’s local printer rather than the system printer. The “-PV” flag (used in element 7) tells filePro Plus to display the output on the user’s video screen.