Incompatible Types TString and TCaption when using memos

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jul 2009
Posts: 17
Reputation: revski is an unknown quantity at this point 
Solved Threads: 0
revski revski is offline Offline
Newbie Poster

Incompatible Types TString and TCaption when using memos

 
0
  #1
Oct 19th, 2009
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:
Pascal and Delphi Syntax (Toggle Plain Text)
  1. Memo1.Lines.AddStrings(Memo2.Lines);
  2. Memo1.Lines.AddStrings(Memo3.Lines);
  3. Memo1.Lines.AddStrings(Edit1.Text);
  4. 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.
Last edited by revski; Oct 19th, 2009 at 8:51 am.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 859
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 140
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark
 
0
  #2
Oct 19th, 2009
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).
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC