Defining The Product File Automatic Processing Table

Remember in Lesson 7, we created a two-element, automatic processing table for the Customer file. Now you will create another automatic table that will calculate data for the protected fields we created on our product file data-entry screen.

Ø        One field is “value on hand” and its value is:

 cost x quantity on hand

Ø        The other field is “profit %“. Its value is:

 price-Cost/cost x 100

Ø        The third field is “total profit”. Its value is:

 price- cost) x quantity sold

Here is the automatic processing table. All text following an apostrophe is a comment. You do not have to enter comments if you do not want to.

(Elements 1—3)

Element 1 If the system-maintained field. “creation date”, has some value in it, (the current record has data in it) then put into the “value on hand” field (7) the results of multiplying the “unit cost” field (6) by the “quantity on hand” field (4).

Element 2 Variable “p” (length: 7, edit: 2 decimal places) is assigned the value resulting from the expression, ~ which gives the difference between the price and the cost as a per-cent profit.

The value in p is given to variable “pr”, which is a dummy field on the product data-entry screen. The “{“ concatenates, or “attaches”, the literal symbol, “%“, to the value of pr.

Element 3 Variable “tp” (length: 8, edit: two decimal places) is assigned the value resulting from the expression, which finds the difference between the price and the cost and then multiplies that by the quantity sold.

image\fig15-1.gif

Figure 15-1

Use choice “5- Define Processing” from the filePro Plus main menu. Take choice "1 - Automatic Processing" and type in the table as shown above.

After you have typed in this processing table, save it and check it.

When you see the Define Processing menu, select “2 - Input Processing”. There is an input processing table we should enter to help the user enter data in the product file. We will do this in the next lesson.