Hi there
Been busy practicing for my practical programming exam. And I've been bumping into this specific bug.

Please have a look at my code, and tell me if you spot anything wrong.
Regards
Grant
Been busy practicing for my practical programming exam. And I've been bumping into this specific bug.
Please have a look at my code, and tell me if you spot anything wrong.
Regards
Grant
Code:
Public Class Form1
Dim strProvinces(8) As String
Dim i As Integer = 0
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click
Dim blnFlag As Boolean = False
Do While blnFlag = False
If String.IsNullOrEmpty(Me.txtInput.Text) Then
blnFlag = True
MsgBox("Empty")
Me.txtInput.Focus()
Exit Do
Else
If Me.txtInput.Text = strProvinces(i) Then
blnFlag = True
MsgBox("Duplicate Found")
Me.txtInput.Clear()
Me.txtInput.Focus()
Exit Do
Else
If i >= 9 Then
blnFlag = True
MsgBox("There is only 9")
Me.txtInput.Clear()
Exit Do
End If
End If
End If
strProvinces(i) = Me.txtInput.Text
lsbDisplay.Items.Add(strProvinces(i))
i = i + 1
Loop
Exit Sub
End Sub