Computer Science Canada array script is out of range |
Author: | spencerbr [ Sat Dec 09, 2006 12:37 pm ] | ||
Post subject: | array script is out of range | ||
I tried adding this into my paint program but it lags the program, screws up the tools, and then cuts out after 10 buttons and says "array script is out of range" |
Author: | spencerbr [ Sat Dec 09, 2006 12:43 pm ] | ||
Post subject: | |||
already found 1 flaw in the code
|
Author: | Clayton [ Sat Dec 09, 2006 1:03 pm ] |
Post subject: | |
It's either because your variable c8 goes above 10 or below 0, check to make sure which it is, then post back here. |
Author: | spencerbr [ Sat Dec 09, 2006 1:22 pm ] |
Post subject: | |
i did if c8 < 1 then c8 := 10 end if |
Author: | Clayton [ Sat Dec 09, 2006 1:25 pm ] |
Post subject: | |
Can you please highlight where you get the error then? |
Author: | Clayton [ Sat Dec 09, 2006 1:26 pm ] |
Post subject: | |
Actually, I figured it out, when c8 > 10, you set it to 0, then right away you use it to make a new picture, but your array only goes from 1 .. 10, so therefore 0 is out of bounds of the array. |
Author: | spencerbr [ Sat Dec 09, 2006 1:31 pm ] |
Post subject: | |
ill try that |
Author: | spencerbr [ Sat Dec 09, 2006 1:38 pm ] |
Post subject: | |
it works now it undo and redos every little mouse movement |