Closed maxkleiner closed 4 years ago
items are possible: procedure integerHashtest2; //Here’s unit with those TIntegerHash2 described @ begin with TIntegerHash2.Create do begin try items['one']:= 1; items['two']:= 2; //ShowMessage(hash['one']); if exists('one') then write(itoa(items['one'])); write(itoa(items['two'])); Rename('one', 'onerename'); write(itoa(items['onerename'])); finally Free; end end; end;
best would be items of key and value procedure stringHashtest; var hash : TStringHash2; //Here’s unit with those TIntegerHash2 and TStringHash2, TObjectHash2 described @ basehash: THash2; begin hash:= TStringHash2.Create; try hash['one']:= 'viens value'; hash['two']:= 'divi value';
//ShowMessage(hash['one']); //ShowMessage(hash['two']); if hash.exists('one') then writeln(hash['one']); writeln(hash['two']); hash.Rename('one', 'onerename'); writeln(hash['onerename']); finally hash.Free; end; end;