April 28, 2024, 02:24:21 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


hashing without associative arrays

Started by Jerry Muelver, November 30, 2006, 12:13:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jerry Muelver

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

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?

Jerry Muelver

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

Ionic Wind Support Team

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.
Ionic Wind Support Team

Jerry Muelver

Perfect! Just as I suspected -- EBasic cleans up the messes we amateur programmers create. I'm on a roll, here!  ::)