well, let's test it. Simply change the length of string st.
If we add some char every loop it should run infinite if Len(st)^2 gets calculated every time.
Uses "console"
String st = "12345"
Long i
For i = 1 To Len(st)^2
Print "iterated i up to "
Print i In 15
Print " while st = """
Print st In 15
PrintL $DQ
st &= Hex$(i,2)
Next
WaitKey
Now what would you say?
By the way, For-Next has the ability to check for a special condition in thinBasic using keyword When so that gets tested every loop.
Check this out:
Uses "console"
String st = "12345"
Long i
For i = 1 To Len(st)^2 When LEFT$(st, 3) = "123"
Print "iteration "
PrintL i In 15
If i = 17 Then
st = "0" & st
EndIf
Next
WaitKey
Bookmarks