1. how to print

I am trying to print to the printer
the code as 

integer printer
printer = open ("lpt1","wb")
puts(printer,"TESTING")
close (printer)

actually i take these code from the Forum
But nothing was printed
Any help?
Thanks you

new topic     » topic index » view message » categorize

2. Re: how to print

mark wrote:
> I am trying to print to the printer
> the code as 
> 
> integer printer
> printer = open ("lpt1","wb")
> puts(printer,"TESTING")
> close (printer)
> 
> actually i take these code from the Forum
> But nothing was printed
> Any help?
> Thanks you

Hi Mark

You might just need to send a linefeed to get the printer to print, eg:

puts(printer,"TESTING" & #0A) -- linefeed

A printer won't print anything until it sees a line feed or a form feed (#0C). 
It makes sense, because what if your next line is

puts(printer, " TESTING 1 2 3") 

and the printer has already started printing?

I'm not sure what the reason is for not printing when it sees the end of the
file though (as per your example).

Gary

new topic     » goto parent     » topic index » view message » categorize

3. Re: how to print

Hi Gary
Thanks for the suggestion
But it does not work with &#OA

I find out if use form feed seems to print
ie puts(printer,FORMFEED)
where FORMFEED is declared beforehand
 as CONSTANT FORMFEED=12

new topic     » goto parent     » topic index » view message » categorize

4. Re: how to print

mark wrote:
> 
> Hi Gary
> Thanks for the suggestion
> But it does not work with &#OA
> 
> I find out if use form feed seems to print
> ie puts(printer,FORMFEED)
> where FORMFEED is declared beforehand
>  as CONSTANT FORMFEED=12

YEs, I think it will depend on how the printer is set up too.  #0A (a zero BTW,
#0A = 10 dec, it looks like an O above..) works with my HP LJ 2100

Gary

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu