The selection table is a text file that represents the selection table you use when the -s is use in the dreport or rreport line. It saves the logical relation sequence in the first line and all the table data on the remaining.
(a or b)If you want to print all lines of order # 1035 and the order # field is 1, the file will look like this:
a:1:eq:9999
b:1:eq:3333
:::
:::
:::
:1:eq:1035
:::
:::
:::
:::
One of my customers wanted a cash register application that produces one line for every different item on the invoice. That is, if I scan three times the same item it would produce only one record with qty purchase = 3 instead of producing three separate records. This approach conflicts with conventional cash register applications that produces a line every time and item is scan. I was thinking in using the best of all filepro capabilities to do this task. The Qty Purchase stuff was easily done the problem was to incorporate the dreport and the dclerk applications together. Thanks to filePro version 4.5 I could do this easily. A batch file, text file instructions and the use of exit were the key to success.
The batch file looks like this:
del \filepro\ordergen\now.sel
\fp\dclerk ordergen -xa -s1 -lx -d -h "CASH REGISTER"
if not errorlevel 1 goto end
\fp\dreport olines -f invoice -s now -u -j -h "Printing Invoice"
:end
At escape I write the following code using 4.5 text files instructions. Depending on the operating systems (Unix/Linux or Windows/DOS/Novell) you will use the following lines:
if:
then: fh(1,.0)=creat ("\filepro\ordergen\now.sel")
----------------------------------------------
if:
then: er = writeline (fh,"")
----------------------------------------------
if:
then: er = writeline (fh,":1:eq"&1)
----------------------------------------------
if:
then: er = close (fh)
----------------------------------------------
if:
then: exit ("1")
----------------------------------------------
Note that \filepro\ordergen\now.sel is the full path to the filepro orders file. Now.sel is the name of the selection table that we will use. Field 1 is order number.
When the dreport line is run the selection table now.sel exists. The dclerk have created it!