Run Time Error 4: "Array index out of bounds"
#4

its not about changing the prices, its the algorithm. the script is fucking up a (most prolly positive) value, the 30000 gets changed to -30000, causing the script to fail when accessing a negative adress..
however, i doubt that simply changing/removing a minus "-" char from a formula will make the script work.
i cant imagine any circumstance where you need an array with 30000 cells, concerning vehicles - the maximum vehicle amount is 2000, so there is a design flaw somewhere. give us some code to examine, i cant predict what will happen when you try to access Array[30000] instead of [-30000]. instead of stopping, it will most prolly return the same error (out of bounds) due to the wrong value used (30000) as pointer:
use -30000 as pointer, and tell the price inside cell -30000. wrong.
use 30000 as pointer, and tell the price inside cell 30000. wrong too.
its more like
use X as pointer, and tell the price inside cell X. should return 30000.
when X is a small value like 25, "car number 25" ( Array[25]=30000; ) could store the value: 30000 or -30000, where Array[30000]=25; is indeed looking similar, but is significally different.
Reply


Messages In This Thread
Run Time Error 4: "Array index out of bounds" - by pepy - 12.08.2012, 10:40
Re: Run Time Error 4: "Array index out of bounds" - by Babul - 12.08.2012, 10:55
Re: Run Time Error 4: "Array index out of bounds" - by pepy - 12.08.2012, 11:26
Re: Run Time Error 4: "Array index out of bounds" - by Babul - 12.08.2012, 23:39
Re: Run Time Error 4: "Array index out of bounds" - by pepy - 14.08.2012, 23:27

Forum Jump:


Users browsing this thread: 2 Guest(s)