I'm building a tool that sends a request besides my browser request using TIdMappedPortTCP from Indy 9.
I want to use string #$d#$A (line breaks) by writing it in memo as %0D%0A
but it's not working fine, as you can see in the image.
What's the correct code I should use to make this work?
procedure TForm1.IdMappedPortTCP1Execute(AThread: TIdMappedPortThread);
var
memo:string;
begin
memo:= Memo1.text;
if Combobox4.text='Back' then begin
AThread.NetData := AThread.NetData +memo ;
form2.Memo1.Lines.Add(AThread.NetData);

TIdMappedPortTCPis a multi-threaded component. TheOnExecuteevent is triggered in the context of a worker thread. You CANNOT access yourTMemoandTComboBoxcontrols directly like you have shown. You MUST synchronize with the UI thread in order to access them safely and correctly.Try something more like this:
With that said, you should not be putting
%0D%0Ain the Memo text at all. Each line in a Memo is already separated by a line break. Reading theMemo.Textproperty returns a string where each line is separated by the value of the RTL'ssLineBreakconstant (which is defined as#13#10on Windows). So just omit%0D%0Afrom your text and type in natural line breaks instead, and let the RTL handle the rest for you.If you absolutely must keep
%0D%0Ain the text, you will have to strip off the native line breaks and then convert%0D%0Ainto native line breaks manually, eg: