Can any please tell me what I am missing in this very simple for to loop ?
Code:For index As Integer = 15 To 21 Step 1 MsgBox("This is the loop no : " & index.ToString) 'If index = 22 Then ' MsgBox("This is the loop 22 : " & index.ToString) ' Exit For 'End If Next
When I run the code it increments to 21 and then start from 15 again. It never exits the loop. I have also tried if endif exit for(commented out ).
Clearing I am missing something very basic, but I'm missing it.
Regards




Reply With Quote
