procedure TForm1.Button1Click(Sender: TObject); var Buffer: PChar; Size: Byte; begin Size := Edit1.GetTextLen; Inc(Size); GetMem(Buffer, Size); Edit1.GetTextBuf(Buffer,Size); Edit2.Text := StrPas(Buffer); FreeMem(Buffer, Size); end;