0

Hi, i am trying to add Label captions and Combobox text values to a memo when the button is clicked, and keep recieving the error 'Incompatible Types TString and TCaption' when i try to add values from labels and comboboxes

Im using the code like this:

Memo1.Lines.AddStrings(Memo2.Lines);
Memo1.Lines.AddStrings(Memo3.Lines);
Memo1.Lines.AddStrings(Edit1.Text);
Memo1.Lines.AddStrings(Label1.Caption);

i need to know how i can get around this problem and how can i make values appear on the same line in the memo

for example i need Memo2 with a blank line after, then memo 3 with a blank line after, and then Label1.Caption and Edit1.Text on the same line in the memo.

Edited by revski: n/a

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by pritaeas
0

For an empty line you can use Memo1.Lines.Add('') .

Line 3 and 4 should use this method too, because they are strings. Lines 1 and 2 add a TStrings object (a collection of strings).

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.