Threads in blitz?

Blitz3D Forums/Blitz3D Programming/Threads in blitz?

>I believe he means things like slowly loading in a bitmap
>image, say at 500 bytes per frame at a time, then creating
>the bitmap from within blitz.

http://www.blitzbasic.com/Community/posts.php?topic=46103#513419
It's more complex than that. The image example was just a small demonstration of how to do this.

Basically you divide the code into the smallest possible components, put each component into an IF...THEN or SELECT...CASE structure and then keep a counter that is modified by the small pieces of code themselves.

If you do it right, you can simply plugin your threaded routine and make a simple call in your main loop.

EDIT: I don't use timers or any other complications in my own code. The pro is that I avoid complication and always spend the least possible time on the function. The con is that loading is slower than with a timed approach, but as you can simply prioritize what and when things are loaded, this is not really a concern.

As I always say, simple beats complex almost every time.


Andy