943,969 Members | Top Members by Rank

Ad:
Apr 13th, 2005
0

help needed to print from turbo pascal

Expand Post »
im still struggling to print an invoice that i have made in pascal to a usb port printer. any help please. i have tried using various inbuilt function but have had no luck probably because im coding it wrong. thanks in advance
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mpx10 is offline Offline
9 posts
since Apr 2005
Apr 13th, 2005
0

Re: help needed to print from turbo pascal

Quote originally posted by mpx10 ...
im still struggling to print an invoice that i have made in pascal to a usb port printer. any help please. i have tried using various inbuilt function but have had no luck probably because im coding it wrong. thanks in advance
This works in Delphi 7 / WinXP:

Pascal and Delphi Syntax (Toggle Plain Text)
  1. program ptest;
  2.  
  3. {$APPTYPE CONSOLE}
  4.  
  5. uses
  6. SysUtils,
  7. Printers;
  8.  
  9. begin
  10. Printer.BeginDoc;
  11. Printer.Canvas.TextOut(200,200,'Hello, world!');
  12. printer.EndDoc;
  13. end.

I don't have/use Turbo Pascal so can't say if it works there as well...
Reputation Points: 10
Solved Threads: 0
Light Poster
Jackrabbit is offline Offline
31 posts
since Jan 2005
Apr 14th, 2005
0

Re: help needed to print from turbo pascal

tried it in turbo pascal but it doesnt work its says cannot find file 'sysutils.tpu' thanks for your help though!! any other ideas please.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mpx10 is offline Offline
9 posts
since Apr 2005
Apr 15th, 2005
0

Re: help needed to print from turbo pascal

About the only thing I could suggest would be to write the information to a file the use the Exec function (in DOS unit -- at least it is in Free Pascal) to launch NotePad or WordPad and print from there.

If you're running Windows, you could also move up to Delphi. I've also had pretty good luck with Lazarus (although I haven't used it much). It's an open source IDE for Free Pascal similar to Delphi.
Reputation Points: 10
Solved Threads: 0
Light Poster
Jackrabbit is offline Offline
31 posts
since Jan 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Help Me
Next Thread in Pascal and Delphi Forum Timeline: Returning from a sleep screen using Delphi





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC