Quote Originally Posted by dmantione
Quote Originally Posted by PP2005
I really don't understand how this could cause an error, since the values assigned to X and Y will always be within the range of a Word.
Check the intermediate results 20 - random(40) can go below zero, which can cause problems if you mix it with a word. It is probably something like this. Split the expression up in smaller parts, this should give a clue.
But in the code excerpt I'm making sure that the X and Y values are both higher than 50. Since the lowest value of "20 - Random(40)" is -19, how can this be a problem? 50 - 19 is well within the range of a Word. Is it just that BP7.0 doesn't like mixing Words with arithmetic operations that can go below zero?