这个程序能不能改成“查找号码功能”

来源:百度知道 编辑:UC知道 时间:2024/06/17 04:48:38
这个程序能不能改成“查找号码功能”

原程序要点是:点conmd1把text1窗口内的12行中都共有的号提出来放入text2中. 修改要点是在原程序
基础上改成“查找号码功能”:
就是把text1窗口内数据中其中只有4行都有相同6个的号码提出来放入text2中 (原程序是把text1窗口
内所有的12行中都共有的号提出来,现在要改成把其中只有4行有相同的6个号码提出来)(双色球数据)

这次结果应该有: 05 17 19 27 28 32 这一组
====================================================

Private Sub Command1_Click()
Dim a() As String
a = Split(Text1.Text, vbCrLf)
For i = 1 To 33
For j = 0 To UBound(a)
If InStr(a(j), Format(i, "00")) = 0 Then
Exit For
ElseIf InStr(a(j), Format(i, "00")) <> 0 And j = UBound(a) Then
Text2.Text = Text2.Text & Format(i, "00") & " "
End If
Next
Next
End Sub

=============================================
在text1 窗口内的检验数据

06 07 14 19 21 23
03 18 21 24 27 33
06 08 11 18 27 32
02 04 09 24 31 32
05 07 09 10 17 19 20 22 27 28 29 32
05 10 17 18 19 20

Private Sub Command1_Click()
Dim myLine() As String, mySingle() As String, a As Integer, b As Integer, c As Integer
myLine = Split(Text1.Text, vbCrLf)
For a = 0 To UBound(myLine)
For b = 0 To UBound(myLine)
If a <> b Then
If zhzsucyg(myLine(a), myLine(b)) = True Then c = c + 1
End If
Next
If c >= 3 Then Text2.Text = Text2.Text & myLine(a) & vbCrLf'这句改了就好啦
c = 0
Next
End Sub

Private Function zhzsucyg(myFirstStr As String, mySecondStr As String) As Boolean
Dim myTempStr1() As String, myTempStr2() As String, a As Integer, b As Integer, myCount As Integer
myTempStr1 = Split(myFirstStr, " ")
myTempStr2 = Split(mySecondStr, " ")
For a = 0 To UBound(myTempStr1)
For b = 0 To UBound(myTempStr2)
If UBound(myTempStr1) = 5 Then
If myTempStr1(a) = myTempStr2(b) Then myCount = myCount + 1