on Nov 6th, 2016, 8:35pm, michael wrote:| This program will be needed later for the 2 major projects I am working on. |
|
Something not right here:
Code: DEFPROCrect(x%,y%,w%,h%) LOCAL sx%,sy% sx%=x%:sy%=y% IF x%>w% THEN x%=w%:w%=sx% IF y%>h% THEN y%=h%:h%=sy% ry%=y% y%=ry%
Those last two lines are definitely strange!
Also, the variables sx% and sy% appear to be unnecessary. Let's examine this code in isolation:
Code: sx%=x% IF x%>w% THEN x%=w%:w%=sx%
First note that sx% is used only in this code snippet. That means we can move it into the conditional clause without affecting the functionality:
Code: IF x%>w% THEN sx%=x%:x%=w%:w%=sx%
But having made that change, we can see that the code is identical in its operation (but slower than) this:
Code:
Richard.