Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2026-10

TStrings.IndexOf(String, Integer) question

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bart

Hi,

TStrings has
-  function IndexOf(const S: string): Integer; virtual;
-  function IndexOf(const S: string; aStart : Integer): Integer; virtual;

TStringList has
- function IndexOf(const S: string): Integer; override; It does not override the second variant.

TStrins does not declare these functions as overload. As a result you cannot call/use TStringList.IndexOf(String, Integer)

Is this intentional or simply an oversight?

Bart

Reply by email

Michael Van Canneyt
to Bart
Bart wrote 14 lines
Hi, TStrings has - function IndexOf(const S: string): Integer; virtual; - function IndexOf(const S: string; aStart : Integer): Integer; virtual; TStringList has - function IndexOf(const S: string): Integer; override; It does not override the second variant. TStrins does not declare these functions as overload. As a result you cannot call/use TStringList.IndexOf(String, Integer) Is this intentional or simply an oversight?

An oversight, please add an issue to the bugtracker.

Michael.

Reply by email