home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pctchnqs / 1991 / number5 / ljcodes.bas < prev    next >
BASIC Source File  |  1991-09-08  |  1KB  |  33 lines

  1. Sub Command4_Click ()            ' "SEND CODES TO PRINTER" BUTTON
  2.   
  3.   Picture1.Print "Sending codes directly to printer,"
  4.   Picture1.Print "which had better be LaserJet-II compatible!"
  5.   
  6.   ' Constructs LaserJet codes and sends to printer.
  7.   ' For brevity, this does NOT draw the same pattern
  8.   ' as the other three procedures.
  9.  
  10.   Screen.MousePointer = 11      ' HOURGLASS CURSOR
  11.  
  12.   Open "PRN" For Output As #1   ' OPEN PRINTER AS FILE
  13.  
  14.   For i = 0 To 600 Step 50      ' PRINT SOME RECTANGLES
  15.  
  16.     ' Position to column i, row i...
  17.     Print #1, Chr$(27); "*p"; Format$(i); "y"; Format$(i); "X";
  18.  
  19.     ' Print a 50 x 100 rectangle with shading depending on i...
  20.     Print #1, Chr$(27); "*c50ac100b"; Format$(Int(i / 6)); "g2P";
  21.   
  22.   Next i
  23.  
  24.   Print #1, Chr$(27); "*p700y100X";   ' POSITION PRINT CURSOR
  25.   Print #1, "PC Techniques"           ' PRINT LABEL
  26.  
  27.   Print #1, Chr$(12);         ' FORM FEED
  28.   Close #1                    ' CLOSE PRINTER
  29.  
  30.   Screen.MousePointer = 0     ' NORMAL CURSOR
  31.  
  32. End Sub
  33.