LOCAL lnI >CLEAR > >? "FOR loop:" >lnI = 0 >FOR lnI = 1 TO test(lnI) > ? lnI >NEXT > >? "" >? "DO loop:" >lnI = 1 >DO WHILE lnI < test(lnI) > ? lnI > lnI = lnI + 1 > IF lnI >= 5 > EXIT > ENDIF >ENDDO > >FUNCTION test >LPARAMETERS tnI > RETURN tnI + 1 >I'd suggest using a DO WHILE loop as changing the loop boundaries in a FOR loop is usually considered bad form in most languages. In some languages the definition may state that doing so is considered an error -- but leaves it to the implementation on what actually happens (i.e. it may give runtime error, or it might not).