Quote Originally Posted by 2kaud View Post
Thanks for your comments and suggestions. Yes, I think your second point is the problem as well - although the program has got a load of other problems besides, now that I've had time to look more closely through the code to try to understand the flow.
Maybe it would be easier to figure out what the ultimate goal of that piece of code is supposed to be instead of trying to understand the flow. The problem with trying to understand the flow of code that is, for all practical purposes with code like this, it leaves you open to miss something subtle (the subtlety occurs only because of the spaghetti-like logic that was used).

I recently had to change code that was so badly written, I had to redo the entire module. I wasn't going to waste time trying to figure out all the twists and turns, when I already knew what the code was supposed to accomplish.

Regards,

Paul McKenzie