Re: [fpc-pascal] Cross platform question about lpi file content

2020-10-01 Thread Michael Van Canneyt via fpc-pascal
On Wed, 30 Sep 2020, Sven Barth via fpc-pascal wrote: Lazarus is not Delphi. In Delphi this worked, because on Windows the GUI libraries are always available and Windows doesn't care if you use UI code in a "console" binary. On other systems (especially Linux and BSD) this might not be the c

[fpc-pascal] TFPGMapObject duplicate errors

2020-10-01 Thread Ryan Joseph via fpc-pascal
I expected to get an assertion when I added the duplicate key "foo". What am I doing wrong? type TSomeMap = specialize TFPGMapObject; var map: TSomeMap; begin map := TSomeMap.Create(true); map.Duplicates := dupError; map.Add('foo', TObject.Create); map.Add('foo', TObject.Create); Reg

Re: [fpc-pascal] TFPGMapObject duplicate errors

2020-10-01 Thread Vojtěch Čihák via fpc-pascal
I looked to code, it gives error only when map is Sorted=True.   function TFPSMap.Add(AKey: Pointer): Integer; begin   if Sorted then   begin     if Find(AKey, Result) then       case Duplicates of         dupIgnore: exit;         dupError: Error(SDuplicateItem, 0)       end;   end else     Result