home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / pb / library4 / scanp2.bas < prev    next >
BASIC Source File  |  1990-10-31  |  2KB  |  67 lines

  1. 'Program Name    : ScanP2.bas scans screen - builds pixel image for printer
  2. 'Author          : Lloyd Smith for Spectra Tech Support
  3. 'Date            : 10-31-90
  4. 'Compuserve #    : GO PCVENB, Vendor #12/Spectra,  Tech Support ID 71530,2640
  5. 'Tech Support BBS: 813-625-1721, PC-Board, 8,N,1 USR HST 300 - 14.4, 24hrs
  6. 'Tech Support Fax: 813-625-1698  G2 & G3 compatible
  7. 'Tech Support Voc: 813-625-1172  Voice
  8. 'Description     : Program scans a 640 x 350 ega screen and prints to Citizen
  9. '                : or Epson compatible printer
  10.  
  11. DIM  static Parray(1125,1)
  12. width "lpt1:",255
  13. gosub ParrayInit
  14. gosub PrintInit
  15. screen 9,,0,0
  16.  
  17. color 12,0
  18. for i=1 to 25
  19. locate i,1:print "This is a test of the system  ABCDEFGHIJKLOMNOPRSTUVWXYZ, line #";i;
  20. next i
  21.  
  22.  
  23. ycnt=0
  24. for y1=0 to 350 step 8
  25. for x1=0 to 639
  26. if point(x1,y1)>0   then a=128 else a=0
  27. if point(x1,y1+1)>0 then b=64  else b=0
  28. if point(x1,y1+2)>0 then c=32  else c=0
  29. if point(x1,y1+3)>0 then d=16  else d=0
  30. if point(x1,y1+4)>0 then e=8   else e=0
  31. if point(x1,y1+5)>0 then f=4   else f=0
  32. if point(x1,y1+6)>0 then g=2   else g=0
  33. if point(x1,y1+7)>0 then h=1   else h=0
  34. Parray(x1,1)=a+b+c+d+e+f+g+h
  35. k$=inkey$:if k$=chr$(27) then system 'exit scan routine
  36. next x1
  37. gosub PrintScnArray
  38. gosub ParrayInit
  39. next y1
  40. end
  41.  
  42. ParrayInit:
  43. for xx=0 to 1045
  44. Parray(xx,1)=0
  45. next xx
  46. return
  47.  
  48. PrintScnArray:
  49. ' Print the screen buffer to the printer
  50. dts= (80*13+2)  '960  'num or dots
  51. n1 = dts mod 256
  52. n2 = int(dts/256)
  53.  
  54. k$=inkey$:if k$=chr$(27) then system
  55. LPRINT CHR$(27)"L"CHR$(n1)CHR$(n2);   '120 dots/in or 960 dots/line
  56. FOR x = 0 TO dts-1
  57. LPRINT CHR$(int(Parray(x,1)));
  58. NEXT x
  59. LPRINT
  60. return
  61.  
  62. PrintInit:
  63.  LPRINT CHR$(27)"~0"CHR$(16): REM CITIZEN MEMORY LINE FEED INCREMENT
  64. ' LPRINT CHR$(27)CHR$(51)CHR$(20): REM EPSON MEMORY LINE FEED INCREMENT
  65. return
  66.  
  67.