unit SetSelTextBuf;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.dfm}

// BeginExample: SetSelTextBuf
// Method: StdCtrls.TCustomEdit.SetSelTextBuf

// BeginCode
{
This example inserts the contents of temp_string at the
current location of the cursor.
} 
procedure TForm1.Button1Click(Sender: TObject);
var
  temp_string: array[0..15] of Char;
begin
  temp_string := 'I am now here';
  Memo1.SetSelTextBuf(temp_string);
end;

procedure TForm1.FormCreate(Sender: TObject);
const Path = 'readme.txt';
begin
  Memo1.Lines.LoadFromFile(Path);
end;
// EndCode
// EndExample: SetSelTextBuf
end.
