Forum > Portuguese

Access the next occurrence of an argument in a TStringList

<< < (4/4)

TRon:

--- Quote from: Remy Lebeau on June 08, 2024, 08:32:34 pm ---Which seems to contradict FreePascal's documentation in this case:

--- End quote ---
According to Delphi's wiki documentation the indexof with offset neither exists for TStringlist nor TStrings :shrugs:

Remy Lebeau:

--- Quote from: TRon on June 09, 2024, 12:06:27 am ---According to Delphi's wiki documentation the indexof with offset neither exists for TStringlist nor TStrings :shrugs:

--- End quote ---

That is correct, but that is not the issue.  I did a test in Delphi where a base class has public overloaded virtual methods, a derived class that overrides only 1 of them, and then call both overloads via a pointer to the derived class:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---type  TTestBase = class  public    procedure DoIt(AValue: Integer); overload; virtual;    procedure DoIt(AValue1, AValue2: Integer); overload; virtual;  end;   TTest = class(TTestBase)  public    procedure DoIt(AValue: Integer); override;  end; ... var  t: TTest; t := TTest.Create;t.DoIt(1);t.DoIt(2, 2);t.Free;
It works fine in Delphi without needing to type-cast to the base class.

The same test should work in FreePascal as well (ie, calling both IndexOf() overloads on a TStringList object without type-casting to TStrings).  If it doesn't work, then it should be reported as a compiler bug.

Navigation

[0] Message Index

[*] Previous page

Go to full version