The 0 should be num in your loop wink
And you should add a break and somehow save the function pointer as this is probably a slow function.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com