Well before stepping into the loop... just make sure you have properly coded the lenght, which means correctly spotted your separator " - " ...

HTH
Carim