Entering Data In The Invoice File

Now that we have explained the input processing table, let’s see how it works when you enter data in the invoice file. If you have created all the files, screens, processing tables, and data shown in this tutorial so far (the “invc” file structure, screen, and input processing table have been provided for you), use the file name “invc” in step 1. of this lesson. If you have not created everything demonstrated so far, use the file name “fpinvc” (the “fpinvc” file is complete and is included in your filePro Plus software).

 

1. From the main menu, select option “B - Inquire, Update, Add. For the file name, type or select:

  fpinvc (or invc)

For screen number, press "1"..

2. Select option “3 - Add Records”.

3. With the cursor in the “Customer Number” field, type: "99". Press <RETURN>

The browse lookup window appears. The window shows the customer number field and first and last name fields from the records in the customer file (processing element 16).

4. Move the highlight to customer Sam Davis, and press <RETURN>. Sam Davis’s customer number is copied into the “customer number” field (process-ing element 20) and other information from Sam Davis’s record is copied into the customer information fields in the invoice record (label, “custok”, element 21).

5. The cursor has moved to the first “Product Code” field. Press <?> and press <RETURN>. Another browse lookup window appears. This one shows the product code and description fields from the records in the product file (processing element 35).

6. Move the highlight to the entry for “lamp”, and press <RETURN>. The cursor is moved to the Quantity field. Press <RETURN>.

The product code for the lamp is copied into the product code field (element 37). In the next Product Code field enter “NEW”. Notice the screen from the product file is displayed (element 84). Finish the data as follows:

 

 

 

 

Product Code

205

 

Description

Glass bowl

 

Price

95.00

 

Quantity On Hand

75

 

Unit Cost

45.00

 

 

 

7.    You can add more items to the invoice. When you are finished with the in-voice, press <ESC> to save it. Enter at least three more invoices; make sure that at least two are for the same customer.

The filePro Plus Processing Debugger

Before we leave the invoice file let’s take a look at the filePro Plus Debugger. A debugger is a program that helps you find errors in a program. The filePro Plus debugger lets you examine and step through a processing table. Let’s see how it works.

1. Return to the Inquire, Update, Add menu by pressing <CTRL> <BREAK> to leave Add Records mode.

2. Now press <X> to return to the menu. Take choice “1 - Record Number” and to the “Record Number?” prompt press <1> or <RETURN>. Record number 1 is displayed.

There are three ways to turn on the debugger. From a menu, the flag, “-db” on the command line turns it on. Inside processing the “DEBUG ON” command turns it on, and finally, in “Inquire, Update Add” if you type “!b” when a record is dis-played, the debugger will be turned on.

3. At the “Enter Selection >“ prompt type: "!b". Nothing happens. This is because processing is not being executed yet. Now proceed to update the record by pressing <U>. Since the debugger is now turned on, the cursor was about to enter field 1 (“customer number”), and filePro Plus saw the label, @WEF1, processing is about to start at the element where the label, @WEF1 was encountered. In our processing table the label is on element 5.

The debugger displays the element about to be executed on the bottom of the screen. filePro Plus has already evaluated the condition line (“If’ statement) and knows whether it is “true” or “false”. This is displayed on the left hand side just under the data—entry screen. The “action statement” has not yet been executed. If the condition line has evaluated “false” then the action line (“Then” statement) will not be executed.

The fPmanual contains a complete list of debugger commands. You can also see a list of commands on the screen by pressing the HELP key, <F1O>.

4. We will use the “5” option to single step through a few lines of our processing table. Press <S>. The next element (element 6) appears. The condition (If sw ne "") has evaluated to false. Let’s look at variable “sw” to see what data it currently has in it. Press <F> to “field display” variable sw. Now type: "SW" and press <RETURN>.The bottom of the screen shows two broken vertical lines. These lines mark the beginning and ending of the displayed field’s data. Since there is nothing between them field “sw” is empty; that’s why the condition (sw ne ““) is false.

Now let’s look at field number 1. Type: "1" and then press the <SPACEBAR> twice. The customer number for record 1 is displayed at the bottom of the screen.

5To leave “field display” mode press <CTRL> <BREAK>. Press <S> to single step to the next element. The condition statement of element 7 is also false. Press <S> again to step to element 8.

6.    Since the condition statement of element 8 is empty, it evaluates to “true” and the “action statement” will be executed. Notice that the action statement in element 8 contains a “gosub unpost” command. Press <S> and notice that the program has “jumped” to element 53, the element that starts the “unpost” subroutine. Press <S> twice more, until element 55 is displayed. We now want to evaluate the expression “item(ix)”. Press <E> for “expression”. Now type: "item(ix)". Press <RETURN>

7. The results are displayed as with command “F’ for field display. Press <CTRL> <BREAK> to leave the “expression mode” and press <S> until element 59 is displayed. Element 59 controls the loop that unposts the individual line items on the invoice. It will cause filePro Plus to “goto” the “unpost1” label as long as variable “ix” contains a value less than 4.

8. To bypass stepping through the loop for each line item let’s set a “break point” on the condition that “ix” is equal to a “4”. Setting a break point tells the debugger to stop whenever a certain condition is met. filePro Plus’s debugger lets you set break points when a particular line is executed, when a certain condition is met, or when the value of a particular field is changed. Press <B> for break point. Take choice “C”, condition. You are presented with an “If’ statement to fill in (“Enter Condition” shown). The format and syntax is exactly the same as a normal “If’ statement in processing. Type:

  ix="4”

Press <RETURN>.

9. Now tell the debugger to let the processing operate continuously until a break point is encountered by pressing <C> for continuous mode. The processing runs until line 59 increases the value of “ix” to be equal to 4. The line that caused the condition to be met (true) is displayed and the word BREAK is displayed next to the word TRUE under the data-entry area.

10   To turn off the debugger press <Q> for “quit”. Make any changes you want to the data and press <ESC> to save the record. As you can see, the filePro Plus debugger can be a big help when trying to find logical problems associated with complex processing tables.

11 When you are finished, return to the main menu.