Tile based platform game collision :(

BlitzPlus Forums/BlitzPlus Programming/Tile based platform game collision :(

I need some help with some tile based platform game collision. I'm actually converting some DB platform game code that can be found here

http://underwaredesign.com/prod_detail.php?rnd=2069544173&id=20

Go down to the collision and intersection section and get the top one.

My code is here

http://www.binarymoon.co.uk/preview/platform_test.zip

The code works fine if you only move in one direction. As soon as you get into a collision on a diagonal it messes up.

I can't see what i have done wrong... any help would be appreciated