Recent

Author Topic: [SOLVED] Loop till end of a memo if the lines.count increases during the loop?  (Read 2087 times)

alveselvis2

  • New Member
  • *
  • Posts: 10
Hi everyone, my question is simple: how can I make a loop (for i:=0 to Memo.Lines.Count-1) if, during the loop, the Lines.Count increases?

I'm doing a script to jump a line each time X happens, so that, in the end, the Lines.Count is higher than previously and, therefore, the script isn't running until the end of the text.

Thanks in advance.
« Last Edit: July 22, 2018, 06:16:18 am by alveselvis2 »

Handoko

  • Hero Member
  • *****
  • Posts: 5122
  • My goal: build my own game engine using Lazarus
Repeat until and while do loops are more suitable for the case.
« Last Edit: July 22, 2018, 05:57:10 am by Handoko »

alveselvis2

  • New Member
  • *
  • Posts: 10
That's perfect, thank you!

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Repeat until and while do loops are more suitable for the case.
You forgot goto and label. O:-) :D :D :D :D
(Oh, well... :()
Specialize a type, not a var.

 

TinyPortal © 2005-2018