Solved

How to access to LPT Port

Posted on 1998-09-14
4
310 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
  • 2
4 Comments
 
LVL 2

Expert Comment

by:kjteng
Comment Utility
0
 
LVL 10

Expert Comment

by:viktornet
Comment Utility
Do you need it for printing text???
0
 
LVL 10

Accepted Solution

by:
Jacco earned 50 total points
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now