Recent

Author Topic: TStringList Question  (Read 928 times)

nugax

  • Full Member
  • ***
  • Posts: 232
TStringList Question
« on: April 29, 2022, 07:36:33 pm »
Do TStringList start at 0 or 1?
-Nugax

wp

  • Hero Member
  • *****
  • Posts: 11857
Re: TStringList Question
« Reply #1 on: April 29, 2022, 07:59:30 pm »
0

Bart

  • Hero Member
  • *****
  • Posts: 5275
    • Bart en Mariska's Webstek
Re: TStringList Question
« Reply #2 on: April 29, 2022, 10:28:06 pm »
but only if instantiated...

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: TStringList Question
« Reply #3 on: May 19, 2022, 07:56:39 pm »
all Tstring, Tlist, Tcontainer, Tmemo.lines,... and many more objects/class start with index 0 and run to (Txx.count-1).  That makes it consistent across predefined objects/classes so you do not need to be an expert to use them.  learn the basics of array handling for one and your good for the others.
I look for a .count and .items[] elements in any class/object I have not used before  and if found, I know the basic indexes needed to step though the list.
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

 

TinyPortal © 2005-2018