You do not need the Do
loop at all and you can simplify the rest of your loop logic, like this:
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
For Each i As String In ListBox1.Items
ListBox2.Items.Add(MYFUNCTION(i))
Next
End Sub
You do not need to look out for the END
marker, because everything in the file was read into the ListBox1.Items
collection, thus once you have looped through all of the string values in ListBox1.Items
, then you are at the end of the file.
The MYFUNCTION
logic returns the transformation from number to letter, thus just add the result of that function into ListBox2.Items
and you are done.