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