Printing help needed

 BBS: Inland Empire Archive
Date: 01-27-93 (18:23)             Number: 350
From: BOB EDWARDS                  Refer#: NONE
  To: STEVE PERRY                   Recvd: NO  
Subj: Printing help needed           Conf: (2) Quik_Bas
SP>I left a message about 4 days ago about needing some help printing
  >graphic screens for a Hewlitt Packard LaserJet (any) and for IBM

   -8<--------- cut here ------------------------------------------

  ' ***********************************************
  ' **  Name:         HPDUMP                     **
  ' **  Type:         Program                    **
  ' **  Module:       HPDUMP.BAS                 **
  ' **  Language:     Microsoft QuickBASIC 4.x   **
  ' ***********************************************
  '
  ' Display some graphics in  EGA mode and then
  ' calls the HP Dump routine.
  '
  ' USAGE:        No command line parameters.
  ' REQUIRMENTS:  EGA or VGA

  ' From PC Magazine - Feb 29, 1988
  ' draw some junk on the screen to test the screen dump

  ' subprograms
        DECLARE SUB Ega.HP ()

        SCREEN 9
        FOR x = 1 TO 150 STEP 2.5           ' display test pattern
                LINE (x + 300, x)-(300 - x, 300 - x), 7, B
        NEXT x
        CALL Ega.HP
        END

  ' ***********************************************
  ' **  Name:         Ega.HP                     **
  ' **  Type:         Program                    **
  ' **  Module:       HPDUMP.BAS                 **
  ' **  Language:     Microsoft QuickBASIC 4.x   **
  ' ***********************************************
  '
        SUB Ega.HP STATIC

                EgaLength% = 28000                  ' size of EGA memory
                DEF SEG = &HA000                    ' EGA screen segment
                BSAVE "$TMP.TM1", 0, EgaLength%     ' BSAVE the screen image

                e$ = CHR$(27)                       ' escape
                Hdr$ = e$ + "*t75R"                 ' 75 dpi resolution
                Hdr$ = Hdr$ + e$ + "*r1A"           ' initialize graphics

                EgaData$ = SPACE$(EgaLength%)       ' room for screen image
                DEF SEG                             ' reset segment
                BLOAD "$TMP.TM1", SADD(EgaData$)    ' BLOAD it into EgaData$

                ' create new image file
                FileNo% = FREEFILE
                OPEN "$TMP.TM2" FOR RANDOM AS #FileNo% LEN = 86
                FIELD #FileNo%, 6 AS Start$, 80 AS Dat$

                LSET Start$ = e$ + "*b80W"          ' start graphics command

                FOR x% = 1 TO EgaLength% STEP 80    ' data from original file
                        LSET Dat$ = MID$(EgaData$, x%, 80)
                        PUT #FileNo%
                NEXT x%
                CLOSE #FileNo%

                LPRINT Hdr$;                        '
LPRINT the header directl
                SHELL "COPY $TMP.TM2/B LPT1: >NUL:" ' copy
the image file to HP
                LPRINT e$; "*rB"; e$; "E";          ' end-of-graphics + reset
                KILL "$TMP.TM?"                     ' delete temporary files

        END SUB

   -8<--------- cut here ------------------------------------------

Hope this is of some help.

 * QMPro 1.01 42-2582 * Don't worry the next message will be better!


--- WM v2.05/91-0232
 * Origin: The Sanctuary 607-648-6284 Chenango Forks, NY (1:260/455)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET