Hello
I am trying to convert a for next loop into a do loop because I want to add a condition.
This code works perfectly:
But when I converted it:
This doesn't work at all.
Please suggest me the correct code.
Or tell me how to add condition in a for next loop.
I am trying to convert a for next loop into a do loop because I want to add a condition.
This code works perfectly:
Code:
Dim LastNonEmpty As Integer = -1
For i As Integer = 0 To mnar.Length - 1
If mnar(i) <> "" Then
LastNonEmpty += 1
mnar(LastNonEmpty) = mnar(i)
End If
Next
Code:
i = 0
Do while i = wnar.Length - 1
If wnar(i) <> "" Then
LastNonEmpty2 += 1
wnar(LastNonEmpty2) = wnar(i)
End If
Loop
Please suggest me the correct code.
Or tell me how to add condition in a for next loop.