is 39 the end of your code? if so, that error is because you didn't end a repeat loop, and SB expects an 'until' before the end of the code.