Solved

How to access to LPT Port

Posted on 1998-09-14
4
314 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
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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
Mobile Keyboard covers the display of the TMemo 3 95
find a node in VST 2 70
Delphi...Split view - idea? 1 88
Tvertscrollbox like a whatsapp layout 5 34
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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

792 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