Delphi / Object Pascal · Exception
What does Runtime Error 213: Collection index out of range mean in Delphi / Object Pascal?
An index into a TCollection or similar indexed collection class was outside the collection's current bounds.
An index into a TCollection or similar indexed collection class was outside the collection's current bounds.
Check the index against the collection's Count property immediately before use, rather than relying on a count captured earlier that may be stale if items were added or removed since.