×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Printing Problem

Printing Problem

Printing Problem

(OP)
a computer program (.EXE) i wrote, prints out a report
immediately on some computers..but on other computers
the Print goes into action immediately..then stops..then Red Light flashes on Printer...if you then press the red button, printing resumes normally and the page is printed and ejected

any ideas on how to make the page printout everytime on different computers/printers ??

   MaxRace Software - Larry Meaux
     ET_Analyst for DragRacers
    Support Israel - Genesis 12:3

RE: Printing Problem

Not knowing what is in the report, the most likely candidate
is an escape or control sequence causing the printer to pause or creating a false error (i assume the report ends up looking ok).

Windows-only printers can be hard or almost impossible to
print on from qbasic (that's why they are called that),so
my advice is NEVER buy a windows-only printer. You are severly limited, and there are other operating systems which
may not be able to use it.

That said, does the report print ok if it's one page text ?

(that is, text only).

Or, is it multiple pages causing the problem by chance ?

If all else fails, you could try creating an html file of the report, calling iexplore.exe and have the user print it
from there.

There is also a dos print program for printing epson ESC/P
reports to most any printer that is set up.

RE: Printing Problem

(OP)
i thought by now a lot of people/programmers would have run into this same problem ??..and someone would have had a quick & easy fix already :)

tested on 6 different computers ( Win95, Win98,ME, XP-Pro so far) all with various models of HP printers

the only one working perfectly everytime is Win98 with HP 990 printer..will always printout .

i 1st noticed this problem years ago with Win95 HP printer
having to push the flashing red light button on the Printer to finish the print job ...prints out great after that .  i use to tell the customer just press the red button it will printout OK, but now want to solve the problem.

i've since rewritten/converted code to VBDOS 1.0 but still same problem as QB4.5 or QB7.1-PDS versions

just writting and executing this simple Code in VBDOS
will cause this problem with Printer

Printer.Print ""
Printer.ENDDOC

will cause the Printer to initially and immediately start the Print job..but then pause until red light flashes..and to continue the Printing, you have to push this button..then resumes and Printed page is OK
=======================================================

That said, does the report print ok if it's one page text ?

(that is, text only).

Or, is it multiple pages causing the problem by chance ?
-----------------------------
Doesn't matter..same results
even if you try to Print simple (VBDOS1.0)
Printer.Print "Hello"
Printer.ENDDOC

or just simple

LPRINT "Hello"  in QB4.5 or QB7.1-PDS

=======================================================

If all else fails, you could try creating an html file of the report, calling iexplore.exe and have the user print it
from there.
-------------------
yes i thought about that also, but probably will just RUN a Visual Basic 1.0 version EXE that will take the VBDOS generated Text file with Color and Font tags built in to change Font size and style along with Colors printing thru the VB-Win 1.0 EXE from VBDOS EXE..probably better in long run,,just thought someone would have had an answer by now ?






 






   MaxRace Software - Larry Meaux
     ET_Analyst for DragRacers
    Support Israel - Genesis 12:3

RE: Printing Problem

how about a chr$(12) at the end
or endpage for VB/PB before enddoc

RE: Printing Problem

Did you happen to use OPEN LPT1, for LPRINT does that for you.

Also, if these are Windows Printer, that means that they have Windows Drivers.  Qbasic LPRINT talks to DOS drivers, which are different (I think it uses the driver, it might talk to the printer itself), but either way the printer is designed to notice that he command is not coming from its driver and will ask you what to do.

RE: Printing Problem

(OP)
printer.PRINT "Hello"
printer.PRINT CHR$(12)
printer.ENDDOC

Thanks Buff1 the CHR$(12) worked !!
but now the Page Prints out immediately, but then the Red Flashing Light on the HP Printer comes on "after" the page is printed

a small step in the right direction ?? :)
now you have to push the red light button to turn it off :)
but atleast you have the page

Thanks QBasicKing also

   MaxRace Software - Larry Meaux
     ET_Analyst for DragRacers
    Support Israel - Genesis 12:3

RE: Printing Problem

(OP)
Heres the actual code i'm using and trying to PRINT with

DIM Cnt AS INTEGER
DIM Y AS INTEGER, X AS INTEGER, Num AS INTEGER
DEF SEG = &HB800

Num = FREEFILE
OPEN "LPT1:" FOR OUTPUT AS #Num
WIDTH #Num, 100
PRINT #Num, ""


FOR Y = 2 TO 25  '-----50 or 25, depending on screen height
   FOR X = 1 TO 80
      PRINT #Num, CHR$(PEEK(160 * (Y - 1) + (X - 1) * 2));
   NEXT X
   PRINT #Num,
NEXT Y

PRINT #Num, ""

FOR Cnt = 8 TO (List1.ListCount - 1)
   PRINT #Num, List1.List(Cnt)
NEXT

  IF LEN(Note$) THEN
    PRINT #Num, ""
    PRINT #Num, "File Name:  " + FileName$
    PRINT #Num, ""
    PRINT #Num, Note$
  END IF

CLOSE #Num
DEF SEG
Printer.ENDDOC

END SUB

   MaxRace Software - Larry Meaux
     ET_Analyst for DragRacers
    Support Israel - Genesis 12:3

RE: Printing Problem

try Width #num,255

This prevents a CRLF (or CR) if it goes past what would be
Column 80 on an 8.5 x 11 at 10CPI.

RE: Printing Problem

so are you trying to print what's displayed on the screen
with the peek ?

looking at a page of memory for the screen ?

if that is true, why not just use x$=screen(x,y):print #num%,x$;

(i think that's the right syntax)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close