crazy loop !!! HELP ME

hi

i have a loop :

for(i=32;i>=0;i--)
{
	if(i%8 == 1) { StartPositionX = -40; }
	if(i<8)
	{ StartPositionX -= 4; print("i : " + i + " - X : " + StartPositionX); }
	else if(i>=8 && i<16)
	{ StartPositionX -= 4; print("i : " + i + " - X : " + StartPositionX); }
	else if(i>=16 && i<24)
	{ StartPositionX -= 4; print("i : " + i + " - X : " + StartPositionX); }
	else if(i>=24)
	{ StartPositionX -= 4; print("i : " + i + " - X : " + StartPositionX); }
}

this loop print “StartPositionX” variable for me after minus it by 4 and reset it to “-40” after i%8 equals 1 .

but when last condition comes , result goes crazy !!! here is the result(in image) :

38423-3.jpg

i don’t know why “StartPositionX” variable in last condition don’t minus by 4 !!!

How can I Fix It ?

I just ran the script and look like it was fine on my side[38425-screen+shot+2015-01-08+at+2.47.45+pm.png|38425]

is it possible that the Variable StartPositionX gets affected by other factors?
Is it a public variable? is set on to be equal transform later in your script?