home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programming Unleashed / Delphi_Programming_Unleashed_SAMS_Publishing_1995.iso / misc / dfm2txt / main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-03-21  |  899 b   |  47 lines

  1. unit Main;
  2.  
  3. { Program copyright (c) 1995 by Charles Calvert }
  4. { Project Name: DFM2TXT }
  5.  
  6. { Example of how to convert a DFM file to a text file.
  7.   Also see the CONVERT.EXE program in the ..\DELPHI\BIN
  8.   subdirectory. }
  9.  
  10. interface
  11.  
  12. uses
  13.   SysUtils, WinTypes, WinProcs,
  14.   Messages, Classes, Graphics,
  15.   Controls, Forms, Dialogs,
  16.   StdCtrls;
  17.  
  18. type
  19.   TForm1 = class(TForm)
  20.     Button1: TButton;
  21.     procedure Button1Click(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27.  
  28. var
  29.   Form1: TForm1;
  30.  
  31. implementation
  32.  
  33. {$R *.DFM}
  34.  
  35. procedure TForm1.Button1Click(Sender: TObject);
  36. var
  37.   InFile, OutFile: TFileStream;
  38. begin
  39.   InFile := TFileStream.Create('main.dfm', fmOpenRead);
  40.   OutFile := TFileStream.Create('main.txt', fmCreate);
  41.   ObjectResourceToText(InFile, OutFile);
  42.   Infile.Free;
  43.   OutFile.Free;
  44. end;
  45.  
  46. end.
  47.