Adding string to Memo.Lines.text in script breaks the line
Hello,
My problem is this:
I have a memo with text let's say 'Joe'.
In the Onbefore print I check if the family name is Smith so I need to concatenate so as to be Joe Smith.
However the following in the script breaks the line:
Memo.Lines.Text := Memo.Lines.Text+' Smith ';
this too: Memo.Text := Memo.Text+' Smith ';
So instead of 'Joe Smith' the result is:
'Joe
Smith'
My problem is this:
I have a memo with text let's say 'Joe'.
In the Onbefore print I check if the family name is Smith so I need to concatenate so as to be Joe Smith.
However the following in the script breaks the line:
Memo.Lines.Text := Memo.Lines.Text+' Smith ';
this too: Memo.Text := Memo.Text+' Smith ';
So instead of 'Joe Smith' the result is:
'Joe
Smith'
Comments
lines property is a zero based array
memo text property is all the text of the memo.
You could do this:
lTxt := memo1.text; // Internally, it will have 'Joe'#13#10
delete(lTxt,length(ltxt)-1,2);
Memo1.text := lTxt +' Smith';
Thank you very much I will try it!
lTxt := Trim( memo1.text ); // Internally, it will have 'Joe'#13#10
Memo1.text := lTxt +' Smith';