home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / b / baswiz19.zip / PDEMO.BAS < prev    next >
BASIC Source File  |  1993-01-29  |  2KB  |  49 lines

  1. '   +----------------------------------------------------------------------+
  2. '   |                                                                      |
  3. '   |         BASWIZ  Copyright (c) 1990-1993  Thomas G. Hanlin III        |
  4. '   |                                                                      |
  5. '   |                       The BASIC Wizard's Library                     |
  6. '   |                                                                      |
  7. '   +----------------------------------------------------------------------+
  8.  
  9.    DECLARE SUB G11Mode (BYVAL Graphics%)
  10.    DECLARE SUB GN2Display ()
  11.    DECLARE SUB GN2Font (BYVAL FontNr%)
  12.    DECLARE SUB GN2Line (BYVAL X1%, BYVAL Y1%, BYVAL X2%, BYVAL Y2%)
  13.    DECLARE SUB GN2Locate (BYVAL Row%, BYVAL Column%)
  14.    DECLARE SUB GN2Mode (ModeNr%)
  15.    DECLARE SUB GN2Print (Device$)
  16.    DECLARE SUB GN2PrintL (Device$)
  17.    DECLARE SUB GN2Write (St$)
  18.  
  19.    DEFINT A-Z
  20.  
  21.    ' set laser printer if they entered LASER or HP on the command line
  22.    Laser = (INSTR(COMMAND$, "LASER") OR INSTR(COMMAND$, "HP"))
  23.  
  24.    GN2Mode 1                                ' init printer graphics mode
  25.    GN2Font 0                                ' init printer graphics font
  26.  
  27.    GN2Line 0, 0, 479, 639                   ' line from top left to lower right
  28.    GN2Line 479, 639, 479, 0                 ' draw box around entire page
  29.    GN2Line 479, 0, 0, 0
  30.    GN2Line 0, 0, 0, 639
  31.    GN2Line 0, 639, 479, 639
  32.  
  33.    GN2Locate 5, 5                           ' set text cursor position
  34.    GN2Write "Simple BasWiz Printer Test"    ' write text
  35.  
  36.    G11Mode 1                                ' set SCREEN 11 (VGA 640x480 x2)
  37.    GN2Display                               ' display the page (preview page)
  38.  
  39.    IF Laser THEN                            ' depending on LASER setting...
  40.       GN2PrintL "PRN"                       ' _print on HP-type laser printer
  41.    ELSE                                     ' ...OR...
  42.       GN2Print "PRN"                        ' _on Epson-type dot matrix printer
  43.    END IF
  44.  
  45.    GN2Mode 0                                ' close printer graphics mode
  46.    G11Mode 0                                ' restore text screen mode
  47.  
  48.    END
  49.