- Jun 14, 2003
- 10,442
- 0
- 0
im getting confused about what things i have to pass to the search function
our lecture notes do have examples however they are kinda seperate... ie one example of a search function thats taking data from some code we cant see and one example of passing an array to a function but then not doing anything with it.
just looking thru and sometimes it just looks like he's added in magic variables that werent even defined. its doin my nut
heres the main code bit for filling the array
Private Sub cmdT5e_Click()
Private Sub cmdT5d_Click()
Dim intCol As Integer
Dim intRow As Integer
Dim intMyArray(3, 3) As Integer
Dim intFindNum As Integer
Dim intNumSearch As Integer
For intRow = 1 To 3
For intCol = 1 To 3
intMyArray(intRow, intCol) = InputBox("please enter numbers into the array", "Numerical Input Box", 1)
Next intCol
Next intRow
FindNum = InputBox("please select a number to search for","number search",1)
NumSearch = Lsearch(intMyArray(), intFindNum)
txtT5e.text = NumSearch
End Sub
for the search function then is this correct?
Private Function Lsearch(intMyArray() As Integer, intFindNum As Integer) As Integer
thats what im passing through, but now i dont know what to do with it
in the notes theres strDataToSort and intFirst and intLast and it seems none of them are defined at the start.
our lecture notes do have examples however they are kinda seperate... ie one example of a search function thats taking data from some code we cant see and one example of passing an array to a function but then not doing anything with it.
just looking thru and sometimes it just looks like he's added in magic variables that werent even defined. its doin my nut
heres the main code bit for filling the array
Private Sub cmdT5e_Click()
Private Sub cmdT5d_Click()
Dim intCol As Integer
Dim intRow As Integer
Dim intMyArray(3, 3) As Integer
Dim intFindNum As Integer
Dim intNumSearch As Integer
For intRow = 1 To 3
For intCol = 1 To 3
intMyArray(intRow, intCol) = InputBox("please enter numbers into the array", "Numerical Input Box", 1)
Next intCol
Next intRow
FindNum = InputBox("please select a number to search for","number search",1)
NumSearch = Lsearch(intMyArray(), intFindNum)
txtT5e.text = NumSearch
End Sub
for the search function then is this correct?
Private Function Lsearch(intMyArray() As Integer, intFindNum As Integer) As Integer
thats what im passing through, but now i dont know what to do with it
in the notes theres strDataToSort and intFirst and intLast and it seems none of them are defined at the start.
