Turbo Pascal Printing..

I have searched on here but am none the wiser,
could anyone please tell me how to print the program as seen in the window during run time?

any advice greatly appreciated, but would really like a small simple example if poss,ie, hello world example with a print routine...
please....

Comments

  • : I have searched on here but am none the wiser,
    : could anyone please tell me how to print the program as seen in the window during run time?
    :
    : any advice greatly appreciated, but would really like a small simple example if poss,ie, hello world example with a print routine...
    : please....
    :
    The following example only works on local printers:
    [code]
    uses
    Crt;

    var
    f: text;
    begin
    AssignPrn(f);
    Rewrite(f);
    Writeln(f, 'Printing a line');
    Close(f);
    end.
    [/code]
    By writing the contents of the screen in this manner, you can print the screen in your program.
  • Hi zibadian, Thankyou for that,

    I tried that but it doesn't like the 'assignPrn' , I get "Unknown Identifier" do I have to add a 'uses' clause?
    I am using Turbo Pascal for windows v1.5, (so have uses WinCrt instead of Crt.)
  • : Hi zibadian, Thankyou for that,
    :
    : I tried that but it doesn't like the 'assignPrn' , I get "Unknown Identifier" do I have to add a 'uses' clause?
    : I am using Turbo Pascal for windows v1.5, (so have uses WinCrt instead of Crt.)
    :
    I don't know if TPW 1.5 has the Printer unit defined. If it does then that is a good way to perform printing. In that unit there is an open text file called Lst, which is associated with the LTP1 device. All the code necessary to print, is:
    [code]
    uses
    Printer;

    begin
    writeln(Lst, 'Hello World');
    end.
    [/code]

  • : [code]
    : uses
    : Printer;
    :
    : begin
    : writeln(Lst, 'Hello World');
    : end.
    : [/code]
    :

    Hi Zabidan, ok I tried that, I don't have the unit Printer so may have to rethink this bit. thanks for the help anyway. is the printer util a free unit available anywhere?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories