请根据算法将下列程序补充完整。
Function prime(a As Integer) As Boolean
Dim j As Integer
prime = True
j = 2
Do While prime And j <= a \ 2
If a Mod j = 0 Then
prime = False
Exit Do
End If
Loop
End Function
Private Sub Command1_Click( )
Dim i As Integer, a As Integer, b As Integer
Dim count As Integer
a = Val(Text1.Text)
b = Val(Text2.Text)
For i = a To b
If = True Then
List1.AddItem Str(i)
count = count + 1
End If
Next i
Label1.Caption = "素数共有" + Str(count) + "个!"
End Sub