unit TCustomMemoLines;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: TCustomMemoLines
// Property: StdCtrls.TCustomMemo.Lines

// BeginCode
{
This example uses a button and a memo control on a form. 
When the user clicks the button, the content of the specified
file is loaded into the memo, and the fifth line of the file
is written across the top of the form.
}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Memo1.Lines.LoadFromFile('readme.txt');
  Caption:= Memo1.Lines[4];
end;
// EndCode
// EndExample: TCustomMemoLines
end.
