maxkleiner / maXbox4

code compiler script studio
GNU General Public License v3.0
23 stars 10 forks source link

key value hashmap #17

Closed maxkleiner closed 4 years ago

maxkleiner commented 4 years ago

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;

maxkleiner commented 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;