Advertisement
AntoSVK

Save&Load To File - práca so súborom - memo

May 26th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.80 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7.   Dialogs, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Memo1: TMemo;
  12.     Button1: TButton;
  13.     Edit1: TEdit;
  14.     Button2: TButton;
  15.     Edit2: TEdit;
  16.     Label1: TLabel;
  17.     Label2: TLabel;
  18.     Label3: TLabel;
  19.     procedure Button2Click(Sender: TObject);
  20.     procedure Button1Click(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   Form1: TForm1;
  29.  
  30. implementation
  31.  
  32. {$R *.dfm}
  33.  
  34. procedure TForm1.Button1Click(Sender: TObject);
  35. begin
  36. memo1.Text:=Edit1.text;
  37. memo1.Lines.SaveToFile(Edit2.text);
  38. end;
  39.  
  40. procedure TForm1.Button2Click(Sender: TObject);
  41. begin
  42. Memo1.Lines.LoadFromFile(Edit2.text);
  43. Edit1.Text:='';
  44. end;
  45.  
  46. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement