LOOP is a reserved word for new version of PBP (2.60 and latter if my memory serves me well) you can replace it with a REPEAT/UNTILL, WHILE/WEND loop.