HP RPG/XL Programmer's Guide (30318-90001)

5- 5
| 5 | .55 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 6 | .55 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 7 | .60 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 8 | .65 |
| | |
---------------------------------------------------------------------------------------------
| | |
| . | . |
| | |
---------------------------------------------------------------------------------------------
| | |
| . | . |
| | |
---------------------------------------------------------------------------------------------
| | |
| . | . |
| | |
---------------------------------------------------------------------------------------------
| | |
| 28 | 1.00 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 29 | 1.05 |
| | |
---------------------------------------------------------------------------------------------
| | |
| 30 | 1.05 |
| | |
---------------------------------------------------------------------------------------------
Figure 5-3 shows the contents of the postal rates table as it is saved on
disc. The name of this particular disc table file is WGHRATE. It is used
in the program shown in Figure 5-4.
_____________________________________
| |
| 010045 |
| 020050 |
| 030050 |
| 040055 |
| 050055 |
| 060055 |
| 070060 |
| 080060 |
| . |
| . |
| . |
| 280100 |
| 290105 |
| 300105 |
| |
_____________________________________
Figure 5-3. Preexecution-Time Table Entries on Disc
Figure 5-4 shows program segments that look up postal rates contained in
the file, WGHRATE (see Figure 5-3). The program uses the rates to
calculate invoice shipping charges. The program first reads an item from
the ORDER file. It then searches the WGHRATE table (line 7) to find a
weight less than or equal to the item's WEIGHT. When a weight is found,
the corresponding rate is moved to the invoice record field, TABRAT.