home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource1
/
program4
/
rpt_call.smp
< prev
next >
Wrap
Text File
|
1993-02-20
|
3KB
|
91 lines
#include "inkey.ch"
#include "wat.ch"
// The defaults to change
#define ACTL_ {"PRN" , ;
.T. , ;
NIL , ;
.F. , ;
"NONE" , ;
.F. , ;
chr(27)+chr(48) , ;
NIL , ;
1 , ;
64000 , ;
1 , ;
"LINE" , ;
1 , ;
68 , ;
0 , ;
0 , ;
210 , ;
1 , ;
.F. }
//────────────────────────────────────────────────────────────────────────────
FUNCTION Rpt_Call( cwant )
*-- Purpose: To print the reports.
*-- Updated: Mon 10-12-1992 11:47:56
//────────────────────────────────────────────────────────────────────────────
LOCAL cScrSave, ar_, sortby, dte, ctl_ := ACTL_, cb, bSavErr
Pushdbf()
Pushv()
cScrSave := scrsave(0,0, maxrow(), maxcol())
DO CASE
CASE cwant == 'Dept Purch'
// ar_ := PrtDPur()
IF Lastkey() != K_ESC
Sortby := 'DEPT. of PURCHASE '
Dte := dtoc(ar_[1])+" - "+ dtoc(ar_[2])
SELECT (select('PropDept'))
// Save current status of propdept.dbf
Pushdbf()
dbsetorder(1)
dbseek(ar_[3])
SELECT (select('Property'))
// Save current status of property.dbf
Pushdbf()
dbsetorder(6)
// You could do better. I know you could.
SET FILTER TO property->deptpur >= ar_[3] .AND.;
property->deptpur <= ar_[4] .AND.;
property->PurchDate >= ar_[1] .AND.;
property->PurchDate <= ar_[2]
dbgotop() // Activate the filter
// Test to see if there is at least one item to print.
IF eof()
Alert("There is nothing to print, you dummy!")
ELSE
IF(ar_[5], ctl_[1] := "DEPTPUR.DOC",)
devpos( maxrow(), maxcol() )
//──> Good Part
// Skip.
// If the dept is the same, do nothing, else goto next dept.
// eof() returns a logical value to the variable lDone.
cb := {|brk_| dbskip(1), ;
IF(brk_[1]==property->deptpur, NIL,;
propdept->(dbseek(property->deptpur))),;
eof()}
// ────────────────────────────────────────┐
RptDept2( , cb, ctl_, Sortby, Dte)
//─────────────────────────────────────────┘
//──> Good Part End
ENDIF
SET FILTER TO
Popdbf()
SELECT (select('PropDept'))
Popdbf()
ENDIF
ENDCASE
Popv()
Popdbf()
ScrRest( cScrSave )
RETURN NIL