First off, you don't need your fix13and10str() function, as the RTL has its own AdjustLineBreaks() function:
For example:
uses
..., System.SysUtils;
procedure TForm1.btnProcessClick(Sender: TObject);
var
s: string;
begin
s := AdjustLineBreaks(Clipboard.AsText, tlbsCRLF);
// or, just let it use the platform default style...
// s := AdjustLineBreaks(Clipboard.AsText);
m1.Lines.Add(s);
end;
Alternatively, you can assign the clipboard text as-is to a TStrings.Text property and let it parse the line breaks for you:
https://docwiki.embarcadero.com/Libraries/en/System.Classes.TStrings.Text
For example:
procedure TForm1.btnProcessClick(Sender: TObject);
var
sl: TStringList;
begin
sl := TStringList.Create;
try
// sl.LineBreak is set to System.sLineBreak by default...
// sl.LineBreak := sLineBreak;
sl.Text := Clipboard.AsText;
m1.Lines.AddStrings(sl);
finally
sl.Free;
end;
end;
Or simpler (if you don't mind the entire TMemo content being replaced):
procedure TForm1.btnProcessClick(Sender: TObject);
begin
m1.Lines.Text := Clipboard.AsText;
end;
One handy use-case is changing line breaks in text. You can copy the code from the IDE, paste it into Notepad++ (or just open the original file directly in Notepad++), specify a new type of line feed (bare-CR, bare-LF, and CRLF are supported), copy the new text back to the clipboard, and paste it into your app.