The FOR look is being skipped because the variable begins on the value its supposed to end. Change it to: FOR I=O TO 3