Hi,
Look at this test program:
// set window properties
SetWindowTitle( "error" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
global mat as Integer[5,6]
do
col=5
i=1
while col-i>=0 and mat[col-i,2]<>1000
Print( "Inside while i="+str(i) )
inc i
endwhile
Print( "OK" )
Sync()
loop
You will have an error because, when col-i will be negative, mat[col-i,2] will be out of bounds.
Why col-i>=0 and .... not protect by this? it seems that when the first operand of AND is evaluated, the second is evaluated also if the first is false.
Thanks!