Private Sub Form_Load() Me.Hide Open App.Path & "\in.txt" For Input As #1 Open App.Path & "\out.txt" For Output As #2 Do While Not EOF(1) Line Input #1, x List1.Clear Do i = 1 If Asc(Mid(x, i, 1)) < 0 Then List1.AddItem Mid(x, i, 1) x = Replace(x, Mid(x, i, 1), "") Else x = Replace(x, Mid(x, i, 1), "") End If Loop Until Len(x) = 0 Print #2, List1.ListCount Loop Close Close End End Sub
回覆刪除Private Sub Form_Load()
Me.Hide
Open App.Path & "\in.txt" For Input As #1
Open App.Path & "\out.txt" For Output As #2
Do While Not EOF(1)
Line Input #1, x
List1.Clear
Do
i = 1
If Asc(Mid(x, i, 1)) < 0 Then
List1.AddItem Mid(x, i, 1)
x = Replace(x, Mid(x, i, 1), "")
Else
x = Replace(x, Mid(x, i, 1), "")
End If
Loop Until Len(x) = 0
Print #2, List1.ListCount
Loop
Close
Close
End
End Sub