...insert a file in a TMemo at the cursor position?

Author: Thomas Stutz

Category: Files

procedure TForm1.Button1Click(Sender: TObject);
var
  
sl: TStringList;
begin
  
sl := TStringList.Create;
  try
    
sl.LoadFromFile('c:\afile.txt');
    Memo1.SetSelTextBuf(PChar(sl.Text));
  finally
    
sl.Free;
  end;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base