[SOLVED] Remove x number of lines from start of TMemo lazarus / 31-LCL ---------------------------------------------------------------------- fatmonk · 2015-01-15 14:53 0 down vote favorite I'm using a TMemo in Lazarus to display a rolling log, but I want to limit it to the last 500 entries. What I'd like to do is (in pseudo-code): Code: [Select]if (log_TMemo.Lines.Count > 500) then    log_TMemo.Lines := log_TMemo[LinesCount - 500 to LinesCount]; TMemo contains TStrings TMemo.Lines, so I guess a want a way to copy a subset of the TStrings array. Is there a way to do this, or is there another way to achieve a max number of lines in a TMemo? -FM ---------------------------------------------------------------------- engkin · 2015-01-15 15:50 Code: [Select]  while log_TMemo.Lines.Count do     log_TMemo.Lines.Delete(0); ---------------------------------------------------------------------- Bart · 2015-01-15 15:52 You meant obviously: Code: [Select]  while log_TMemo.Lines.Count > 500 do     log_TMemo.Lines.Delete(0); Bart ---------------------------------------------------------------------- fatmonk · 2015-01-15 17:22 That's a nice simple way to do it, ta.  -FM