×
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

Anybody knows the code to PRINT TO LPT1

Anybody knows the code to PRINT TO LPT1

Anybody knows the code to PRINT TO LPT1

(OP)
Hello...

 I just forget the Code to Print to LPT1 Port... you know,
I need to send text to a printer connected in LPT1 port...

 Please Help me.


Thanks
Juanjo

 

Follow the dark side, so you can reach the light.

RE: Anybody knows the code to PRINT TO LPT1

     You can actually worry about sending it to the port but I would recommend against this unless you have good reason.  It's a lot simpler to simply send it to a text file opened to LPT1.  That makes it a lot easier for network redirection and the like.

RE: Anybody knows the code to PRINT TO LPT1

If you include the unit printer, there is a predefined text file variable lst you can use:

USES printer;
BEGIN
  write(lst,'Hello printer!#12'); {Send a string followed by a FF}
END.

If you want to write to a specific port, you can try this:

VAR prn : text;
BEGIN
  assign(prn,'LPT1'); {Other ports may be LPT2, ..., COM1, COM2, ...}
  rewrite(prn);
  write(prn,'Hello printer!#12'); {Send a string followed by a FF}
  close(prn);
END.

Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
http://student.vub.ac.be/~bvingerh/
Don't worry what people think about you. They're too busy wondering what you think about them.

RE: Anybody knows the code to PRINT TO LPT1

(OP)
Thank you very much!! It's the thing I wanted to know...

Thanks

Regards
Juanjo

Follow the dark side, so you can reach the light.

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