	REMARK	****************************************\
		*  P/R170.BAS  PAYROLL CHECK REGISTER  *\
		*     3/14/79               9:20 AM    *\
		****************************************
%INCLUDE CURSOR
	DIM G2$(5),G3(5),S(96),R1(2),R2(5),R$(5)
	GOTO 6000
%INCLUDE SUBS1
%INCLUDE MSTRIN
%INCLUDE GENINFO
825	A1=30								REMARK  ****    LINE PRINTER ROUTINE    ****
	IF LINE.COUNT% < 55  THEN  RETURN				REMARK  IF SPACE REMAINS ON REPORT PAGE, RETURN
	P=P+1								REMARK  INCREMENT PAGE COUNTER
	PRINT CHR$(12)							REMARK  PRINT FORM FEED
	PRINT TAB((A1-LEN(G2$(1)))/2);G2$(1);TAB(A1);"DATE ";		REMARK  PRINT COMPANY NAME AND DATE
	X0=G3(1):GOSUB 680.5
	PRINT
	PRINT TAB((A1-LEN(X4$))/2);X4$;TAB(A1);"PAGE ";P		REMARK  PRINT REPORT TITLE AND PAGE NUMBER
	PRINT
	PRINT " CHECK NO.  NET AMOUNT"
	PRINT
	LINE.COUNT%=6							REMARK  RESET LINE COUNTER FOR NEW REPORT PAGE
	RETURN
6000	DEF FNR(A1)=INT(A1*100+.5)/100					REMARK  ROUNDING FUNCTION
	B$="TOTAL ## CHECKS     AMOUNT ######.##"
	A$="   ######   ######.##"					REMARK  SET UP PRINT MASKS
	PRINT CLEAR.SCREEN$;"P/R CHECK REGISTER"			REMARK  DISPLAY PROGRAM I.D. ON CRT
	PRINT "KEY RETURN TO BEGIN; CTRL-C TO EXIT"
6000.1	IF CONSTAT%=0 THEN GOTO 6000.1 ELSE A%=CONCHAR%			REMARK  POLL KEYBOARD FOR <RETURN> OR CTRL-C
	IF A% = 03H THEN GOTO 7000				REMARK  IF CTRL-C WAS ENTERED, ABORT PROGRAM
	IF A% <> 0DH THEN GOTO 6000.1				REMARK  WAIT FOR <RETURN> TO BE PRESSED

	Y9=2
	OPEN "P/R0F110.DAT" RECL 1150 AS 1				REMARK  OPEN EMPLOYEE MASTER FILE
	OPEN "G/I0F010.DAT" RECL 200 AS Y9				REMARK  OPEN GENERAL INFORMATION FILE
	GOSUB 700							REMARK  READ GENERAL INFORMATION FILE
	LPRINTER							REMARK  SELECT PRINTER AS OUTPUT DEVICE
	X4$="PAYROLL CHECK REGISTER"
	LINE.COUNT%=60
	GOSUB 825							REMARK  PRINT REPORT HEADINGS
	FOR X0=1 TO MSTR.RECORDS					REMARK  PROCESS ENTIRE EMPLOYEE MASTER FILE...

	GOSUB 745							REMARK  READ EMPLOYEE RECORD
	IF S(83)=0 OR R2(1)=99 OR S(1)=0 THEN 6070			REMARK  IF INVALID RECORD WAS READ, GET NEXT 
	LINE.COUNT%=LINE.COUNT%+1
	GOSUB 825							REMARK  CHECK FOR END OF REPORT PAGE
	PRINT USING A$;S(5),S(83)-S(90)				REMARK  PRINT CHECK NUMBER AND NET AMOUNT
	C=C+1								REMARK  ADD TO TOTAL CHECKS PRINTED
	C1=C1+S(83)-S(90)						REMARK  ADD TO TOTAL CHECK AMOUNTS
6070	NEXT X0
	IF C>0 THEN PRINT USING B$;C,C1					REMARK  PRINT CHECK REGISTER TOTALS
7000	CONSOLE
	PRINT CLEAR.SCREEN$;"P/R CHECK REGISTER EXITING"		REMARK  EXIT PROGRAM AND LOAD MENU
	CHAIN "P/R000"
