TMemo....help needed lazarus / 31-LCL ---------------------------------------------------------------------- jshand2010 · 2011-05-28 11:42 hi guys.  just wondering how to get the total nukber of lines in your memo box.  please let me know.  i have tried tmemo.lines.....that doesn't work. ---------------------------------------------------------------------- fabienwang · 2011-05-28 11:53 YourMemo.Lines.Count ---------------------------------------------------------------------- Avishai · 2011-05-28 11:54 I think it's Memo1.Lines.Count ---------------------------------------------------------------------- jshand2010 · 2011-05-30 11:17 thanks for your help i have place in the meinformationChange procedure this code: g := meinformation.Lines.Count; i am unsure if this is working as yet; the following i have coded in the same procedure: for d := 1 to g do   begin       sm[d].information := meinformation.Lines[d];  end; this doesn't seem to work.  please help me.  also loading into the memo box is proving difficult for me as i have little knowledge for this control. thanks again ---------------------------------------------------------------------- eny · 2011-05-30 12:00 Quote from: jshand2010 on May 30, 2011, 01:17:47 pmthis doesn't seem to work. Based on what? Debugger output? Lines in a memo are numbered from 0.. Count-1. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i g := meinformation.Lines.Count;//...for d := 0 to g-1 do  begin     // sm[d].information := meinformation.Lines[d];  <-- WHAT IS smd[d]? end; ---------------------------------------------------------------------- jshand2010 · 2011-05-30 22:25 hi there sm[d].information is an array of strings. ---------------------------------------------------------------------- eny · 2011-05-31 07:54 Quote from: jshand2010 on May 31, 2011, 12:25:30 amhi there sm[d].information is an array of strings. Please post the type definitions. ---------------------------------------------------------------------- jshand2010 · 2011-05-31 11:16 hi eny, below are the type definitions you asked for type   StaffMemo = record     information: string;   end; under vars is: sm: array[1..1000000] of StaffMemo; ---------------------------------------------------------------------- fabienwang · 2011-05-31 11:33 by doing, array[1..1000000], you will take a lot of memory space at the declaration. as you won't use all of them, i suggest you to define the array dynamically, m: array of StaffMemo; maintain a global counter: nbsm: Integer; and each time you want to add lines into it: Inc(nbsm); setLength(sm, nbsm); ---------------------------------------------------------------------- eny · 2011-05-31 11:53 Quote from: jshand2010 on May 31, 2011, 01:16:18 pmhi eny, below are the type definitions you asked for Alrighty, now what is that you wish to accomplisch? Because your initial question has already been answered. (As FabienWang said, you have defined a rather big static array...) ---------------------------------------------------------------------- liewald · 2011-05-31 12:06 Why are you copying the Memo to an array of strings? Memo.lines is essentially a dynamic array of strings anyway with some extra handling built in.  Any line can be accessed using memo1.lines like any normal array. I don’t really understand what you are trying to achieve here. ---------------------------------------------------------------------- eny · 2011-05-31 14:59 Quote from: liewald on May 31, 2011, 02:06:02 pmI don’t really understand what you are trying to achieve here.Hence my question...