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.

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).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.