Forum > Beginners

TStringList Question

(1/1)

nugax:
Do TStringList start at 0 or 1?

wp:
0

Bart:
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.

Navigation

[0] Message Index

Go to full version