Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/21/21 in all areas

  1. Isn't this better suited to a hash set rather than a string list?
  2. Check out the source and you can easily write your own version (a quick example code): uses System.RTLConsts; type TMyStringList = class(TStringList) public function AddObject(const S: string; AObject: TObject): Integer; override; end; function TMyStringList.AddObject(const S: string; AObject: TObject): Integer; begin if sorted then result:=inherited AddObject(S, AObject) else begin result:=IndexOf(s); if (result=-1) then begin result:=count; InsertObject(result, S, AObject) end else begin case Duplicates of dupIgnore: Exit; dupError: Error(@SDuplicateString, 0); dupAccept: begin result:=count; InsertObject(result, S, AObject); end; end; end; end; end;
  3. http://docwiki.embarcadero.com/Libraries/Sydney/en/System.Classes.TStringList.Add
  4. No, there is no way and it's documented that Duplicates works only for sorted lists: Set Duplicates to specify what should happen when an attempt is made to add a duplicate string to a sorted list. The CaseSensitive property controls whether two strings are considered duplicates if they are identical except for differences in case. The value of Duplicates should be one of the following.
  5. Hi, Based on published free header/wrapper units of BASS audio library plus add-ons on www.un4seen.com, I have improved, modified and added more codes to ensure they work with all platforms that Delphi's FireMonkey and VCL frameworks support. I also collected, intensively tested and structured the libraries into a package for Delphi programmers to use with a very detailed guide accompanied. Finally I also included a simple but sufficiently complete demo project. I have seen so many questions on BASS forums as well as other forums regarding audio for Delphi so I just thought I could share my work. That's all my intention. Here you go: https://github.com/TDDung/Delphi-BASS
  6. Stefan Glienke

    recompiling delphi source for Delphi Sydney

    Generics as well but that is related to inlining because generics use a similar mechanism as inlining does. That's why we had some breaking changes in some updates in the past because some devs at Embarcadero obviously forgot about that and fixed some issues in Generics.Collections. I think there are more reasons for F2051 to happen but those that are not solvable by switching around compiler options are those I mentioned to my knowledge. To be honest I am still not fully understanding how inlining is being controlled exactly. For example when I write a for in loop over a TCollection in my code and add System.Classes to my project causing a recompile I see that it does not fully inline but does a call to TList<TCollectionItem>.GetItems which is marked as inline. When I use the dcu shipped with Delphi that call is not there. Changing $INLINE option does not change anything about that. Example code - when looking at the asm you will see the call I mentioned before. When the path to the pas file is removed and it uses the dcu the call is not there. I did not find a compiler option that makes it go away when compiling the pas file. uses System.Classes in 'c:\program files (x86)\embarcadero\studio\21.0\source\rtl\common\System.Classes.pas'; procedure Main; var list: TCollection; item: TCollectionItem; begin list := TCollection.Create(TCollectionItem); list.Add; for item in list do; end; begin Main; end.
×