IonicWind Software

IWBasic => The Roundtable => Topic started by: Jerry Muelver on November 30, 2006, 12:13:01 PM

Title: hashing without associative arrays
Post by: Jerry Muelver on November 30, 2006, 12:13:01 PM
I know Paul's kind of busy these days, so I thought I'd go ahead and bring Muelver's Incredible String Theory Hash over to EBasic. See http://ebasic.wikispaces.com/jlm+ibHash+demo (http://ebasic.wikispaces.com/jlm+ibHash+demo)

Note that the pointer-based use of the heap is warned against in the EBasic Help file, but seems to work anyway. Hmmm.... Do I need to put in some heap cleanup code?
Title: Re: hashing without associative arrays
Post by: Jerry Muelver on November 30, 2006, 01:42:01 PM
Could be. If I use AllocHeap, it's only fair to use FreeHeap to clean up. But where does it go? The subs have to return a pointer to the heap, so it can't be in the sub. Maybe subs clean up after themselves, ya think, maybe?   ???
Title: Re: hashing without associative arrays
Post by: Ionic Wind Support Team on November 30, 2006, 04:09:11 PM
Once you return a heap pointer it is then handled automatically by the parser, which adds code to free the heap at the appropriate point in the code.
Title: Re: hashing without associative arrays
Post by: Jerry Muelver on November 30, 2006, 04:45:30 PM
Perfect! Just as I suspected -- EBasic cleans up the messes we amateur programmers create. I'm on a roll, here!  ::)