Quote:
Originally posted by n[ate]vw
Let's say stack_pos=1 and sw_stacker=100
if stack_pos - sw_stacker > 10 then pos_error
Will this go to pos_error or not?
1-100= -99, which to the controller might be -99 or 157, depending on how it handles negative numbers in this situation.
|
why dont you just take a page out of innovationfirst's book and their basic programming to avoid negatives. try something like this:
if (((stack_pos + 100 - sw_stacker) Min 100) - 100) > 10 then {whatever}
anything that would be a negative number is instead turned into a zero, and all this code is looking at is whether it is less than 10 or not, not by how much it is less than ten.
-Anthony
P.S. i dont know the range of your values, so iff 100 is too little or too much, you can change it accordingly