## Linear Search

Hi..i'm trying to make a program that will be given 2 list of numbers..they are to be sorted and then a 3rd list is a combination of the 2..i think i got the first part right..but i help on how to make it so that the 3rd list will contain numbers from the first two list..and get rid of any duplicate numbers..here is my code..check it out and reply back a.s.a.p on whut i could do or if i need to make changes on anything...! thanks

Dim list1() As Integer
Dim list2() As Integer
Dim Number As Integer
Dim index As Integer
Dim index2 As Integer
Dim i As Integer
Dim x As Integer

Private Sub cmdExit_Click()
End
End Sub

Private Sub cmdSearch_Click()
If txtlist1.Text = "" Or txtlist2.Text = "" Then
MsgBox "Please specify 2 list to search from!"
Else
picOutput.Cls
picOutput2.Cls
picOutPut3.Cls
i = 0
index = 0
Call Counts(list1(), txtlist1.Text, i)
ReDim list1(i) As Integer
Call Place(list1(), txtlist1.Text)
Call Sort(list1(), txtlist1.Text)
For index = 0 To i
picOutput.Print list1(index)
Next index
x = 0
index = 0

Call Counts(list2(), txtlist2.Text, x)
ReDim list2(x) As Integer
Call Place(list2(), txtlist2.Text)
Call Sort(list2(), txtlist2.Text)
For index = 0 To x
picOutput2.Print list2(index)
Next index
End If
index = 0
index2 = 0
Open "a:\stuck in the past's List.txt" For Output As #3
For index = 0 To i
Write #3, list1(index)
Next index
For index2 = 0 To x
Write #3, list2(index2)
Next index2
Close #3
Open "stuck in the past's List.txt" For Input As #1
Do Until EOF(1)
Input #1, Number
If txtSearch.Text = Number Then
MsgBox "number found"
End If
Loop
Close #1
End Sub
Public Function Newlist(ByRef Numarray1() As Integer, ByRef Numarray2() As Integer)
Open txtlist1.Text For Input As #1
Open txtlist2.Text For Input As #2
Do Until EOF(1)
Input #1, Number
Numarray1(index) = Number
index = index + 1
Loop
Do Until EOF(2)
Input #2, Number1
Numarray2(index2) = Number1
index2 = index2 + 1
Loop
Close #2
Close #1
End Function
Public Function Place(ByRef Numarray() As Integer, ByRef Path As String)
Open Path For Input As #2
Do While Not EOF(2)
Input #2, Number
Numarray(index) = Number
index = index + 1
Loop
Close #2
End Function
Public Function Sort(ByRef Numarray() As Integer, ByRef Path As String)
'open the file and read each entry into the array
For Item = LBound(Numarray) To UBound(Numarray)
For index = LBound(Numarray) To UBound(Numarray) - 1
If Numarray(index) &gt; Numarray(index + 1) Then
Temp = Numarray(index)
Numarray(index) = Numarray(index + 1)
Numarray(index + 1) = Temp
End If
Next index
Next Item
End Function
Public Function Counts(ByRef Numbarray() As Integer, ByRef Paths As String, ByRef i As Integer)
'open the file and count how many entries there are
Open Paths For Input As #1
Do While Not EOF(1)
Input #1, Number
i = i + 1
Loop
Close #1
i = i - 1
End Function