Is there something in FreePascal that allows you to store and retrieve objects and give them keys ?
I see there is a thread called 'superfast hash' but I dont see the functions
'insert' and 'get'
Is there something in FreePascal that allows you to store and retrieve objects and give them keys ?
I see there is a thread called 'superfast hash' but I dont see the functions
'insert' and 'get'
There should be a hashtable in contnrs.pas
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
Seems like delphi doesn't have it. At least not there. Some more quick datastructures in the standard library would've been nice.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
I downloaded one from here:http://www.benya.com/code/collections/hashtable.html
but when I try to retrieve an object it crashes:
this is the code im using to test the hashtable
but this line causes the crash:Code:s:=ship_array[0]; hashy.setValue('trev',s); s:=spaceship(hashy.getValue('trev'));
Code:function tHashEntry.getKey : tComparable; begin result := fKey; end;
Last edited by slenkar; 14-11-2010 at 11:06 PM.
There is ThashedStringlist. I've used it for my latest project (non-gamedev related). It's easy to use and does the job well.
Ah thanks. I guess I should really make the move to D2010 or XE.
Coders rule nr 1: Face ur bugz.. dont cage them with code, kill'em with ur cursor.
Bookmarks