home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug159.arc
/
SCRORPRT.PRO
< prev
next >
Wrap
Text File
|
1979-12-31
|
4KB
|
107 lines
* Scrorprt.pro
* A procedure to output to screen or printer
* Get the drive and file name for processing (mdfilename)
* Copy to Tempstor the fields that are required for processing
* (This preserves the data file from possible corruption)
* Ask operator to provide a reference (stored in memvar)
* Process data and keep operator informed
* Complete processing
* Ask operator for screen or printer output
* Set up the appropriate default values for page length etc
* Output the data to the screen or printer
* Exit to calling programme or quit dBase
*
* memvars :mspaces,mdfilename,memvar,
mpagehdg,mreply,mreply2
* memvars :mpagenum,mline,mpagelen,
mcolhdg,mnumrecs,mamt,
* :mcheck,mcount,moutput
*
@ 3,mcolhdg SAY mpagehdg
@ 5,15 SAY '************************************'
@ 6,15 SAY '* *'
@ 7,15 SAY '* LIST TO THE SCREEN. - - - S *'
@ 8,15 SAY '* *'
@ 9,15 SAY '* LIST TO THE PRINTER.- - - P *'
@10,15 SAY '* *'
@11,15 SAY '************************************'
@14,30 SAY ' YOUR SELECTION ? '
@14,50 GET mreply PICTURE '!'
READ
DO CASE
CASE mreply = 'S'
ERASE
STORE 21 TO mpagelen
STORE 23 TO mline
CASE mreply = 'P'
SET FORMAT TO PRINT
* Tell printer that page length is 70 lines
* (11.65 inches) with a 8 line skip
* (assume Epson compatible)
@ 0,0 SAY CHR(27)+CHR(67)+CHR(70)
@ 0,40 SAY CHR(27)+CHR(78)+CHR(8)
* zero the page number counter and load the line
* counter with a number larger than the selected
* report page length so that the heading is
* printed first
STORE 60 TO mpagelen
STORE 61 TO mline
OTHERWISE
ERASE
SET BELL ON
SET TALK ON
RELEASE ALL
RETURN
ENDCASE
STORE 0 TO moutput
* continue output to screen or printer
DO WHILE moutput 1
IF mline mpagelen
IF mreply = 'S'
* printing to the screen
@ 23,15 SAY 'PRESS RETURN KEY TO CONTINUE'
WAIT
ERASE
* page heading for the screen
@ 1,66 SAY 'PAGE NO.' + STR(mpagenum,3)
@ 2,mcolhdg SAY mpagehdg
* ---Generate column headings @ 4,5 SAY ' FIRST HEADING '
@ 4,30 SAY ' NEXT one '
@ 4,64 SAY ' NEXT one '
@ 5,5 SAY '=================='
@ 5,30 SAY '============'
@ 5,64 SAY '============'
STORE mpagenum + 1 TO mpagenum
STORE 5 TO mline
ENDIF
IF mreply = 'P'
* printed page heading
STORE 0 TO mline
<%-2>@ mline,60 SAY 'PAGE NO. ' + STR(mpagenum,3)<%0>
STORE 1 TO mline
@ mline,mcolhdg SAY mpagehdg
* ---Generate column headings.
@ mline + 3,5 SAY ' First heading '
@ mline + 3,30 SAY ' Next one '
@ mline + 3,64 SAY ' Next one '
@ mline + 4,5 SAY '==============='
@ mline + 4,30 SAY '==============='
@ mline + 4,64 SAY '==============='
STORE mpagenum + 1 TO mpagenum
STORE 6 TO mline
ENDIF
ENDIF
*
* Output the information that has been processed
* Increment the line counter
STORE mline + 1 TO mline
@ mline,5 SAY ' Selection criteria 1'
@ mline,31 SAY memvar1
@ mline,64 SAY memvar2
*
* continue processing data
IF data finished
STORE 1 TO moutput
ENDIF
ENDDO * moutput 0