[solved] Memo.lines.add - partly in letter groups lazarus / 21-General ---------------------------------------------------------------------- Nicole · 2022-11-15 12:12 There is a memo which has the duty to show progress. If I would write Memo1.lines.add('a1'); duty 1 Memo1.lines.add('a2'); duty 2 Memo1.lines.add('a3'); duty 3 It would work fine, - but show really (too) many lines. Therefore I would prefer to read instead of a1 a2 a3 to have => a1   a2    a3 ok, let us do this: Memo1.lines.text:=Memo1.lines.text + 'a3'; This would do the job of writing. Unfortunately, the text does not come step by step on progress, but all of it, at the end of the job. My question: How can I make my small words appearing one by one after having being added? They should do just the same as they would do, having being added line by line. (With no refresh-flicker, please.) Thanks. ---------------------------------------------------------------------- jamie · 2022-11-15 13:32 Double buffer property being set isn't working? Also, you may want to enable the use of BeginUpdate and EndUpdate before adding multiple successions. ---------------------------------------------------------------------- KodeZwerg · 2022-11-15 13:34 Why not use a TProgressBar to show/visualize progress and a TLabel that indicate current state of progress? ---------------------------------------------------------------------- Zvoni · 2022-11-15 13:37 Quote from: KodeZwerg on November 15, 2022, 02:34:43 pmWhy not use a TProgressBar to show/visualize progress and a TLabel that indicate current state of progress? That would imply, she knows how many iterations there are (min to Max) ---------------------------------------------------------------------- Dzandaa · 2022-11-15 13:46 Hi, I tried this: 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 procedure TTest.AddStringToMemo(Str: String);begin  Memo.lines.text := Memo.lines.text + Str + ' ';  Memo.Refresh;end; procedure TTest.BTestAddTextClick(Sender: TObject);var i: integer;begin  Memo.Clear;  for i := 0 to 10 do  begin    AddStringToMemo(i.ToString);   Sleep(200);  end; end; With DoubleBuffered Enabled on Memo B-> ---------------------------------------------------------------------- KodeZwerg · 2022-11-15 15:03 Quote from: Zvoni on November 15, 2022, 02:37:28 pmQuote from: KodeZwerg on November 15, 2022, 02:34:43 pmWhy not use a TProgressBar to show/visualize progress and a TLabel that indicate current state of progress? That would imply, she knows how many iterations there are (min to Max) For unknown, marquee... pretty easy, no? ---------------------------------------------------------------------- wp · 2022-11-15 15:24 Quote from: Nicole on November 15, 2022, 01:12:48 pmHow can I make my small words appearing one by one after having being added? 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 procedure AddToCurrLine(AMemo: TMemo; ATxt: String);begin  AMemo.Lines[AMemo.Lines.Count-1] := AMemo.Lines[AMemo.Lines.Count-1] + ' ' + ATxt;end; procedure AddInNewLine(AMemo: TMemo; ATxt: String);begin  AMemo.Lines.Add(ATxt);end; ---------------------------------------------------------------------- Nicole · 2022-11-15 16:31 @WP    cool!! This does exactly what I want. Thank you. Thank all others for the answers as well. And yes, it is a "progress bar" -  with information in my Memo, what is going on in my code. ---------------------------------------------------------------------- Zvoni · 2022-11-15 16:47 Quote from: Nicole on November 15, 2022, 05:31:53 pm@WP    cool!! This does exactly what I want. Thank you. Thank all others for the answers as well. And yes, it is a "progress bar" -  with information in my Memo, what is going on in my code. Then i agree with KodeZwerg: a Marquee is usually the way to go.. ---------------------------------------------------------------------- KodeZwerg · 2022-11-15 18:29 This somehow remind me to the good old days under DOS where the cursor jumped around to update screen content ---------------------------------------------------------------------- Zvoni · 2022-11-15 18:43 Quote from: KodeZwerg on November 15, 2022, 07:29:20 pmThis somehow remind me to the good old days under DOS where the cursor jumped around to update screen content  It reminds me of some code on a C64 i saw once. I think it was a loop (GOTO), peek and poke-ing some color-bits on the screen, showing something like progress ---------------------------------------------------------------------- KodeZwerg · 2022-11-15 20:12 Quote from: wp on November 15, 2022, 04:24:01 pmQuote from: Nicole on November 15, 2022, 01:12:48 pmHow can I make my small words appearing one by one after having being added? 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 procedure AddToMemo(const AMemo: TMemo; const ATxt: String; const AAppend: Boolean = True);begin  if (not AAppend) then    AMemo.Lines[Pred(AMemo.Lines.Count)] := AMemo.Lines[Pred(AMemo.Lines.Count)] + ' ' + ATxt    else    AMemo.Lines.Add(ATxt);end;For automatization working with a boolean might be more useful in my thinking (still I believe that this way of doing is wrong but I would need to see a more complex example instead of "a" "a1" "b" "b1" etc)