home *** CD-ROM | disk | FTP | other *** search
/ Delphi 4 Bible / Delphi_4_Bible_Tom_Swan_IDG_Books_1998.iso / source / README / MAIN.PAS < prev    next >
Pascal/Delphi Source File  |  1998-04-04  |  663b  |  39 lines

  1. unit Main;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, SysUtils, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons;
  8.  
  9. type
  10.   TMainForm = class(TForm)
  11.     Memo1: TMemo;
  12.     BitBtn1: TBitBtn;
  13.     procedure FormActivate(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   MainForm: TMainForm;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TMainForm.FormActivate(Sender: TObject);
  28. var
  29.   FileName: string;
  30. begin
  31.   if ParamCount >= 1
  32.     then FileName := ParamStr(1)
  33.     else FileName := 'Readme.Txt';
  34.   Memo1.Lines.LoadFromFile(FileName);
  35.   Caption := FileName;
  36. end;
  37.  
  38. end.
  39.