Solved

How to access to LPT Port

Posted on 1998-09-14
4
319 Views
Last Modified: 2010-04-06
I need to know how I can access directly to the LPT-Port in Delphi 3.0 We developed a program in Borland Pascal 7.0 and then transfered it to Delphi. In Pascal we used the "port" command. So what do we use in Delphi ?
0
Comment
Question by:sacky
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 2

Expert Comment

by:kjteng
ID: 1339727
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339728
Do you need it for printing text???
0
 
LVL 10

Accepted Solution

by:
Jacco earned 50 total points
ID: 1339729
Use AssignPrn like this

procedure Print;
var
  F: TextFile;
begin
  AssignPrn(F);
  Rewrite(F);
  WriteLn(F,'Hello world');
  System.CloseFile(F);
end;

You can write escape codes like this:

Write(F,#27#12)

Regards Jacco
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1339730
Hello...just for an idea you could alos use this...

procedure Print;
   var
     F: TextFile;
   begin
     AssignFile(F, 'LPT1');
     Rewrite(F);
     WriteLn(F,'Hello world');
     CloseFile(F);
   end;

Haven;t tasted that but you could give it a shot ;->
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question