"ingo" <nomail@nomail> wrote:
> The following line results in an negative subscript error when Z = 0:
>
> #if (Z > 0 & VoxelGrid[X][Y][Z-1] > 0)
>
> I expected the evaluation to terminate, with false, at Z > 0.
>
> Won't say it is a bug, it is just unexpected.
>
> ingo
I ran into this before. The way I got around it is...
#if(Z>0) #if(array[X][Y][Z-1]>0) do_something.. #end #end
I think it is the negative element of the array is accessed during evaluation
that causes the error.
#ifndef with an array with a negative element or a positive element out of range
will cause an error too. Even throuh clearly element [-1] doesn't exist.
Have Fun!
Post a reply to this message
|