[fpc-devel] TStrings.IndexOf(String, Integer) question

Michael Van Canneyt michael at freepascal.org
Sun Oct 4 21:25:13 CEST 2026



On Sat, 3 Oct 2026, Bart via fpc-devel wrote:

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


More information about the fpc-devel mailing list