TIP: Click on subject to list as thread! ANSI
echo: delphi
to: TOM MOORE
from: SYDNEY DU PLOOY
date: 1997-06-09 15:25:00
subject: Re: Printing and searching

Hi there
 TM> unit Unit1;
 TM> interface
 TM> uses
 TM> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
 TM> Dialogs, Menus, StdCtrls, printers;
 TM> type
 TM> TForm1 = class(TForm)
 TM> Memo1: TMemo;
 TM> MainMenu1: TMainMenu;
 TM> File1: TMenuItem;
 TM> Open1: TMenuItem;
 TM> OpenDlg: TOpenDialog;
 TM> Print1: TMenuItem;
 TM> procedure Open1Click(Sender: TObject);
 TM> procedure Print1Click(Sender: TObject);
 TM> private
 TM> { Private declarations }
 TM> public
 TM> { Public declarations }
 TM> end;
 TM> var
 TM> Form1: TForm1;
 TM> implementation
 TM> {$R *.DFM}
 TM> procedure TForm1.Open1Click(Sender: TObject);
 TM> begin
 TM> if OpenDlg.Execute then
 TM> begin
 TM> memo1.lines.loadfromfile(opendlg.filename);
 TM> end;
 TM> end;
 TM> procedure TForm1.Print1Click(Sender: TObject);
 TM> var LinePos: integer;
 TM> i: integer;
 TM> str1: string;
 TM> begin
 TM> Printer.canvas.Font := memo1.font;
 TM> Printer.BeginDoc;
 TM> LinePos := 100;
 TM> for i := 1 to memo1.lines.count - 1 do
 TM> begin
 TM> LinePos := LinePos - printer.canvas.font.height;
 TM> if linepos > printer.pageheight then
 TM> begin
 TM> printer.newpage;
 TM> linepos := 100;
 TM> end;
 TM> str1 := memo1.lines[i];
 TM> Printer.Canvas.TextOut(100,linepos, memo1.lines[i]);
 TM> end;
 TM> Printer.EndDoc;
 TM> end;
 TM> end.
The program works fine but . . . .
the problem now is that it only prints the address smaller that the (  )
space between the brackets.
Please help me out on this one :-) I'm in deep .. . . .
Thanx in advance
Sydney
     sydney@khanya.bbs.co.za
 TM>  ! Origin: Time Passages - 405-372-2880 (1:3814/8)
--- Blue Wave/DOS v2.30 [NR]
---------------
* Origin: Goldfields Echolink - Johannesburg, RSA (5:7101/3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.