A
A
Anton2014-05-17 13:39:02
Delphi
Anton, 2014-05-17 13:39:02

Delphi, carriage return at end of Memo text

If you enter the Memo text editor directly from the form, then the next time you edit it, a carriage return is added at the end, i.e. the end character of all text at the beginning of the last empty line. This is also observed in already running applications.
Question: how to make sure that this would not happen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
ORTOL, 2015-12-03
@ORTOL

Here wrote a function for you...
function DelLastChar(s:string): string;
begin
delete(s, length(s), 1);
result := s;
end;
Using ...
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Text:= DelLastChar(Memo1.Text);
end;
-------------------------------------------------- -------------------------------
You need to use it when starting the program ...
Well, or after loading data into Memo1 ...
And how to achieve this result in the editor, I'm afraid this question is for the developer ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question