PDA

View Full Version : Compiler Bug?



Art
- 31st January 2010, 20:25
This works:


rotatearray:
i = 95 '
FOR cntx = 1 to 95 '
segs[i] = segs[i - 1] '
i = i - 1 '
NEXT cntx '
segs[0] = newcell '
return '


This compiles, but doesn't work as expected:


rotatearray:
FOR cntx = 1 to 95 '
segs[cntx] = segs[cntx - 1] '
NEXT cntx '
segs[0] = newcell '
return '


Cheers, Art.

keithdoxey
- 31st January 2010, 20:34
Substituting the array values for the first three executions of the loops...


This works:


rotatearray:
i = 95 '
FOR cntx = 1 to 95 '
segs[i] = segs[i - 1] '
i = i - 1 '
NEXT cntx '
segs[0] = newcell '
return '




segs[95] = segs[94]
segs[94] = segs[93]
segs[93] = segs[92]
.....



This compiles, but doesn't work as expected:


rotatearray:
FOR cntx = 1 to 95 '
segs[cntx] = segs[cntx - 1] '
NEXT cntx '
segs[0] = newcell '
return '


Cheers, Art.

segs[1] = segs[0]
segs[2] = segs[1]
segs[3] = segs[2]

They dont do the same thing !!!!

Art
- 1st February 2010, 03:30
Oops. :D Human bug.

keithdoxey
- 1st February 2010, 08:42
LOL, there isnt a man or woman amongst us who hasnt created a bug at some point ;)