Quote Originally Posted by TomKerekes View Post
Not sure why the error checking in GetStockSize was removed.
There is no movement in GetStockSize, so shouldn't be any other error checking than if there is a problem getting the values from the screen.

Quote Originally Posted by TomKerekes View Post
MoveUp() isn't returning a 0 value at the end.

It would be good to make the 0.05 offset a #defined value.
Fixed

Quote Originally Posted by TomKerekes View Post
The file is getting pretty big and is now greater than the Thread spaces 1-6 without overflowing into the next Thread. Removing all the debug prints will probably reduce it a lot. We could have been smarter and made the probe routine more general to be able to probe in any direction. This would have been smaller and eliminated so much duplicated code. It would reduce the chances of bugs as well at the expense of somewhat more complex code.
Agree. It's getting a bit unwieldy, but as you've probably understood already (or I have said it earlier), I'm not a programmer...
I have made an attempt at reducing the size. Both the actual probing and moving have now been moved into a single function for each instead of a function for each direction. This makes it a bit more difficult to understand and troubleshoot, though. Another option to reduce the size more, is to split the file into two different files, one for external probing and one for internal probing. Or move everything from the switch/case into each calling program, keep the definitions, MoveDirection and Probe functions still in the main file..

Br,
Stig