1. Home
  2. Computing & Technology
  3. Delphi Programming

TMemo printing

By , About.com Guide

Simple procedure that prints the content of a Memo component...

~~~~~~~~~~~~~~~~~~~~~~~~~
uses printers;

procedure TForm1.PrintIt(Sender: TObject) ;
var
   PrintBuf: TextFile;
j : integer;
begin
   AssignPrn(PrintBuf) ;
   Rewrite(PrintBuf) ;
   try
     for j := 0 to Memo1.Lines.Count-1 do
       WriteLn(PrintBuf, Memo1.Lines[j]) ;
   finally
     CloseFile(PrintBuf) ;
   end;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Here are some more TMemo related articles: TMemo to the Max

Delphi tips navigator:
» Determine the actual size of a Blob field in a Table
« TMediaPlayer: What track am I on?

Explore Delphi Programming
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Delphi Programming
  4. Using VCL Components
  5. TMemo, TRichEdit
  6. TMemo printing

©2009 About.com, a part of The New York Times Company.

All rights reserved.