'===========================================================================
' Subject: SET NEW PRINTER TIMEOUT VALUE      Date: 10-09-93 (14:35)       
'  Author: Rick Pedley                        Code: QB, PDS                
'  Origin: QBTIPS_R.DOC                     Packet: MISC.ABC
'===========================================================================
'TIMEOUT.BAS 
'Sets printer `timeout retry' value to help prevent `printer busy' 
'errors. Most machines copy the value 20 (&h14) from the BIOS into 
'three RAM addresses, corresponding to printer ports LPT1, 2, and 3. 
'Before DOS gives a printer busy error, it cycles 20 x ~260,000 
'times to see if the error has cleared. On a fast computer, say a 
'50 MHz 486, this _may_ not be long enough and even copying a file 
'to the printer from DOS may cause a R)etry, A)bort, F)ail to be 
'displayed. This utility can be run from the DOS prompt or in your 
'AUTOEXEC.BAT. If no parameter is specified, it prints the current 
'values for each port and a short message. If you regularly get 
'printer busy errors even in DOS, run this utility trying different 
'values, starting with something greater than 20, until the errors 
'disappear. 
' 
'R. Pedley, 93-10-09 
 
DEFINT A-Z 
DEF SEG = 64        '0040 
IF LEN(COMMAND$) THEN 
   T = VAL(COMMAND$) 
   IF T > 0 AND T < 256 THEN 
      POKE 120, T   '    :0078 
      POKE 121, T   '    :0079 
      POKE 122, T   '    :007A 
   ELSE 
      BEEP 
   END IF 
END IF 
PRINT 
PRINT "Current printer timeout values are:" 
PRINT 
PRINT "LPT1:"; PEEK(120) 
PRINT "LPT2:"; PEEK(121) 
PRINT "LPT3:"; PEEK(122) 
PRINT 
PRINT "To set a new value, use a parameter between 1 and 255," 
PRINT "e.g. TIMEOUT 45" 
PRINT 
DEF SEG 
