Dec 212017
 
CLIPPER .OBJ file that will do a hardware printer reset. Must be linked with the rest of the program.
File RESETPRN.ZIP from The Programmer’s Corner in
Category Dbase Source Code
CLIPPER .OBJ file that will do a hardware printer reset. Must be linked with the rest of the program.
File Name File Size Zip Size Zip Type
RESETPRN.DOC 3487 1212 deflated
RESETPRN.OBJ 279 244 deflated

Download File RESETPRN.ZIP Here

Contents of the RESETPRN.DOC file


Documentation For RESETPRN()

RESETPRN() is an .OBJ file to be linked with Clipper programs. It will do a
HARDWARE reset of the printer (using hardware port addressing) and is totally
independent of software control codes.

I recommend using RESETPRN only 1 time because it will clear the ENTIRE printer
buffer (I speak from experience). Unlike software codes that are stacked in
the printer's buffer and acted on as they come to the top of the buffer,
RESETPRN() immediately resets the printer and will cancel any text, control
codes or anything else that's waiting in the buffer. I've included the
routine I use called PRNCHKK. It uses a memory variable called reset_prn
which is initialized in the first few lines of code. Once the printer has
been reset, it is not reset again.

Pass this program on to others.
Craig Veal
4734B Jacksonville Lane
Andrews AFB, MD 20335
Phone 301-599-1071


PROCEDURE PRNCHKK
IF .NOT. reset_prn
RESETPRN()
xyz = 1
DO WHILE xyz < 700&& allows the printer to return to ready
xyz = xyz + 1&& condition before testing for ISPRINTER()
ENDDO WHILE xyz < 700&& RESETPRN() works even if the printer is off
IF ISPRINTER()&& so the next few lines of code let you know
STORE .T. TO reset_prn&& the printer is not ready
ENDIF ISPRINTER()
ENDIF .NOT. reset_prn
IF ISPRINTER()
RETURN
ENDIF ISPRINTER()
DO WHILE .NOT. ISPRINTER()
SAVE SCREEN
SET DEVICE TO SCREEN
SET PRINT OFF
STORE "Printer Is NOT Ready" TO msg1
STORE 'Strike Any Key When Problem Has Been Fixed' TO msg2
STORE ' ' TO msg3,msg4
DO CENTER
SET COLOR TO W+/R+
@ 10,40-((LEN(msg1))/2) SAY msg1
SET COLOR TO W+*/R+
STORE "NOT" TO msg1
@ 10,43-((LEN(msg1))/2) SAY msg1
SET COLOR TO W+/R+
@ 12,40-((LEN(msg2))/2) SAY msg2
SET CURSOR OFF
WAIT ''
RESTORE SCREEN
SET DEVICE TO PRINT
SET PRINT ON
ENDDO WHILE .NOT. ISPRINTER()
IF .NOT. reset_prn
RESETPRN()
STORE .T. TO reset_prn
ENDIF .NOT. reset_prn
RETURN
*** EOP: PRNCHKK

PROCEDURE CENTER
SET CURSOR OFF
boxerow = 9
boxlen = 0
boxsrow = 9
IF TYPE("msg1") = 'U'
STORE ' ' TO msg1
ENDIF TYPE("msg1") = 'U'
IF TYPE("msg2") = 'U'
STORE ' ' TO msg2
ENDIF TYPE("msg2") = 'U'
IF TYPE("msg3") = 'U'
STORE ' ' TO msg3
ENDIF TYPE("msg3") = 'U'
IF TYPE("msg4") = 'U'
STORE ' ' TO msg4
ENDIF TYPE("msg4") = 'U'
IF LEN(ALLTRIM(msg1)) >0
boxerow = boxerow + 2
boxlen = MAX(LEN(ALLTRIM(msg1)),boxlen)
ENDIF LEN(ALLTRIM(msg1)) >0
IF LEN(ALLTRIM(msg2)) >0
boxerow = boxerow + 2
boxlen = MAX(LEN(ALLTRIM(msg2)),boxlen)
ENDIF LEN(ALLTRIM(msg2)) >0
IF LEN(ALLTRIM(msg3)) >0
boxerow = boxerow + 2
boxlen = MAX(LEN(ALLTRIM(msg3)),boxlen)
ENDIF LEN(ALLTRIM(msg3)) >0
IF LEN(ALLTRIM(msg4)) >0
boxerow = boxerow + 2
boxlen = MAX(LEN(ALLTRIM(msg4)),boxlen)
ENDIF LEN(ALLTRIM(msg4)) >0
CLEAR
SET COLOR TO GR+/N,W+/B,,,W+/B
@ 08,38-(boxlen/2) CLEAR TO boxerow,41+(boxlen/2)
@ 08,38-(boxlen/2) TO boxerow+1,41+(boxlen/2) DOUBLE
SET COLOR TO BG+/N,W+/B
IF LEN(ALLTRIM(msg1)) >0
@ 10,40-((LEN(ALLTRIM(msg1)))/2) SAY ALLTRIM(msg1)
ENDIF LEN(ALLTRIM(msg1)) >0
IF LEN(ALLTRIM(msg2)) >0
@ 12,40-((LEN(ALLTRIM(msg2)))/2) SAY ALLTRIM(msg2)
ENDIF LEN(ALLTRIM(msg2)) >0
IF LEN(ALLTRIM(msg3)) >0
@ 14,40-((LEN(ALLTRIM(msg3)))/2) SAY ALLTRIM(msg3)
ENDIF LEN(ALLTRIM(msg3)) >0
IF LEN(ALLTRIM(msg4)) >0
@ 16,40-((LEN(ALLTRIM(msg4)))/2) SAY ALLTRIM(msg4)
ENDIF LEN(ALLTRIM(msg4)) >0
SET COLOR TO GR+/N,W+/B,,,W+/B
RETURN
*** EOF: CENTER



 December 21, 2017  Add comments

Leave a Reply