Forum > Beginners

TStringList Question


Do TStringList start at 0 or 1?


but only if instantiated...

mas steindorff:
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.


[0] Message Index

Go to full version