tk.unlimited
Active member
- Joined
- Apr 2, 2005
- Messages
- 27
- Programming Experience
- 1-3
How would i call this public function
Module ArrayStuff
Public Sub copyListboxToIntArray(ByVal theList As ListBox, ByVal theArr() As Integer)
Dim iLimit As Integer
Dim iItemNo As Integer
iLimit = theList.Items.Count
For iItemNo = 0 To (iLimit - 1)
theArr(iItemNo) = CInt(theList.Items(iItemNo))
Next
End Sub
Public Function gradingofIntarray(ByVal theArr() As Integer) As String
Dim icount As Integer
Dim ilimit As Integer
Dim iaMark As Integer
Dim igrading As String
ilimit = theArr.Length
For icount = 0 To (ilimit - 1)
iaMark = theArr(icount)
If iaMark < 0 Then
igrading = ("??")
Else
If iaMark >= 0 And iaMark < 50 Then
igrading = ("NN")
Else
If iaMark >= 50 And iaMark < 60 Then
igrading = ("PA")
Else
If iaMark >= 60 And iaMark < 70 Then
igrading = ("CR")
Else
If iaMark >= 70 And iaMark < 80 Then
igrading = ("DI")
Else
If iaMark >= 80 And iaMark <= 100 Then
igrading = ("HD")
Else
If iaMark > 100 Then
igrading = ("??")
End If
End If
End If
End If
End If
End If
End If
Return igrading
Next icount
End Function
End Module
I want to display it in a listbox so the Grading (HD, DI etc) is input into a listbox when the items are added...
Module ArrayStuff
Public Sub copyListboxToIntArray(ByVal theList As ListBox, ByVal theArr() As Integer)
Dim iLimit As Integer
Dim iItemNo As Integer
iLimit = theList.Items.Count
For iItemNo = 0 To (iLimit - 1)
theArr(iItemNo) = CInt(theList.Items(iItemNo))
Next
End Sub
Public Function gradingofIntarray(ByVal theArr() As Integer) As String
Dim icount As Integer
Dim ilimit As Integer
Dim iaMark As Integer
Dim igrading As String
ilimit = theArr.Length
For icount = 0 To (ilimit - 1)
iaMark = theArr(icount)
If iaMark < 0 Then
igrading = ("??")
Else
If iaMark >= 0 And iaMark < 50 Then
igrading = ("NN")
Else
If iaMark >= 50 And iaMark < 60 Then
igrading = ("PA")
Else
If iaMark >= 60 And iaMark < 70 Then
igrading = ("CR")
Else
If iaMark >= 70 And iaMark < 80 Then
igrading = ("DI")
Else
If iaMark >= 80 And iaMark <= 100 Then
igrading = ("HD")
Else
If iaMark > 100 Then
igrading = ("??")
End If
End If
End If
End If
End If
End If
End If
Return igrading
Next icount
End Function
End Module
I want to display it in a listbox so the Grading (HD, DI etc) is input into a listbox when the items are added...