How to clear a TMemo out of lines? lazarus / 31-LCL ---------------------------------------------------------------------- Elmug · 2011-09-07 01:42 Good people: I have the Memo1 with a few lines, how to clear it to zero lines? I tried lines.count := 0; but that did not work. Then after I clear it, how to put just one line into it, for example: 'This is line1'. And also, where can I find documentation on how to use these methods? that start with a .dotMethod for TMemos, and just as well for other type of objects? Thanks! ---------------------------------------------------------------------- meulinux · 2011-09-07 02:20 Memo1.Lines.Clear; ---------------------------------------------------------------------- Elmug · 2011-09-07 03:24 Quote from: meulinux on September 07, 2011, 04:20:58 amMemo1.Lines.Clear; Great help, meulinux. That's a powerful statement. Now, if you don't mind, where can I learn things like that (part of my original question). Thanks! ---------------------------------------------------------------------- felipemdc · 2011-09-07 05:04 Quote from: Elmug on September 07, 2011, 03:42:48 amAnd also, where can I find documentation on how to use these methods? that start with a .dotMethod for TMemos, and just as well for other type of objects? In google, I just typed "lazarus TMemo" without quotes and the first link was the reference documentation: http://lazarus-ccr.sourceforge.net/docs/lcl/stdctrls/tmemo.html And then you can click on links there are find the reference for TMemo.Lines: http://lazarus- ccr.sourceforge.net/docs/lcl/stdctrls/tcustommemo.lines.html Then click on TStrings: http://lazarus-ccr.sourceforge.net/docs/rtl/classes/tstrings.html Where you can read:   procedure Clear; virtual; abstract;   Removes all strings and associated objects from the list. There are also links to docs here: http://wiki.lazarus.freepascal.org/LCL_Components One other thing, please try to keep questions about the LCL in the LCL sub-forum =) thanks ---------------------------------------------------------------------- BigChimp · 2011-09-07 06:06 Quote from: Elmug on September 07, 2011, 05:24:12 amNow, if you don't mind, where can I learn things like that (part of my original question). See this post - and the next for sources of information on FreePascal, Delphi (handy, as Lazarus is almost always compatible), and Lazarus: http://lazarus.freepascal.org/index.php/topic,13951.msg73534.html#msg7 3534 Don't know if I mentioned it there, but Delphi online documentation can help, too: http://docwiki.embarcadero.com/RADStudio/en/Main_Page, especially the pages under Delphi Reference Hope this helps, BigChimp ---------------------------------------------------------------------- Elmug · 2011-09-07 06:18 Thank you good people, Please don't think I don't try to find the info before I ask, but the Lazarus Ocean is immense (to me a beginner). The .dot methods of components is where I wish there were a compendium, or some book just explaining that. They are the most powerful commands, in a way, specially if one does not know about them much effort has to be afforded. ---------------------------------------------------------------------- felipemdc · 2011-09-07 07:35 Quote from: Elmug on September 07, 2011, 08:18:23 amThe .dot methods of components is where I wish there were a compendium, or some book just explaining that. There is a book: http://www.blaisepascal.eu/index.php?actie=./subscrib ers/lazarusbookinfoEnglish And also the online reference: http://lazarus- ccr.sourceforge.net/docs/lcl ---------------------------------------------------------------------- User137 · 2011-09-07 09:05 Most of the guides are written for Delphi, and they most of the time work for Lazarus too. Google can easily find example codes for delphi problems. ---------------------------------------------------------------------- Elmug · 2011-09-07 20:59 Thanks, User 137. ---------------------------------------------------------------------- Martin_fr · 2011-09-07 23:22 About learning, there are many methods. Google certainly is one, and a good one at that. Another code way (at least for me) is to simply explore. In Lazarus the IDE helps you with code completion. Type Memo1. and ctrl-space, and you see all the methods, finctions, properties. For memo1, you will find:   Text   Lines   Append   Clear   SelectAll You can find them by scrolling through the list, or with growing knowledge and experience, you will have a hunch to look for certain word (start typing them). At this time it will of course be useful, if you know basic pascal. The IDE shows you that "Clear" is a procedure, but "Lines"a property (of type TStrings). So you know that you can search for more under lines. The same way you will find that Memo1.Lines.Count is a function, and can not be assigned.... Best of all, all the source is there, so you can even jump to a method, and see what t does, or in case of a property, jump to it's declaration, and then jump to the declaration of TStrings. --- Btw, not directly related, but if you have not yet read the following page, read it: http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools ---------------------------------------------------------------------- Elmug · 2011-09-08 00:54 Quote from: Martin_fr on September 08, 2011, 01:22:38 amAbout learning, there are many methods. Google certainly is one, and a good one at that. Another code way (at least for me) is to simply explore. In Lazarus the IDE helps you with code completion. Type Memo1. and ctrl-space, and you see all the methods, finctions, properties. For memo1, you will find:   Text   Lines   Append   Clear   SelectAll You can find them by scrolling through the list, or with growing knowledge and experience, you will have a hunch to look for certain word (start typing them). At this time it will of course be useful, if you know basic pascal. The IDE shows you that "Clear" is a procedure, but "Lines"a property (of type TStrings). So you know that you can search for more under lines. The same way you will find that Memo1.Lines.Count is a function, and can not be assigned.... Best of all, all the source is there, so you can even jump to a method, and see what t does, or in case of a property, jump to it's declaration, and then jump to the declaration of TStrings. --- Btw, not directly related, but if you have not yet read the following page, read it: http://wiki.lazarus.freepascal.org/Lazarus_IDE_Tools Thank you, Martin! I've heard about this, but your explanation is excellent and I will start trying it shortly. I do investigate a lot on the web. Have already hundreds of links in folders and subfolders. I even got a book from Marco Cantu on Delphi-7 but he jumps all over me. There's nothing like need that motivates the learning, that's why I have a major project going on for quite a while, and has been the basis of most questions you all great people have helped me with.