F
Flomo Togba Kwele
I wrote the following class:
Public Class CassPrintComparer2
Implements IComparer(Of ICASSPrint)
Private _sortDescending As Boolean = False
'pass true to the constructor to sort descending
Public Sub New(ByVal descending As Boolean)
_sortDescending = descending
End Sub
Public Function Compare(ByVal x As MailHouse2.DataAccess.ICASSPrint, ByVal y
As MailHouse2.DataAccess.ICASSPrint) As Integer
If (_sortDescending) Then
Return y.SerialNo.CompareTo(x.SerialNo)
Else
Return x.SerialNo.CompareTo(y.SerialNo)
End If
End Function
End Class
I get the following syntax error which I cannot figure out:
Error - Class 'CassPrintComparer2' must implement 'Function Compare(x As
MailHouse2.DataAccess.ICASSPrint, y As MailHouse2.DataAccess.ICASSPrint) As
Integer' for interface 'System.Collections.Generic.IComparer(Of ICASSPrint)'.
I just cannot see what I've done wrong. The IDE puts the squiggly error line
under IComparer(Of ICASSPrint).
Thanks, Flomo
Public Class CassPrintComparer2
Implements IComparer(Of ICASSPrint)
Private _sortDescending As Boolean = False
'pass true to the constructor to sort descending
Public Sub New(ByVal descending As Boolean)
_sortDescending = descending
End Sub
Public Function Compare(ByVal x As MailHouse2.DataAccess.ICASSPrint, ByVal y
As MailHouse2.DataAccess.ICASSPrint) As Integer
If (_sortDescending) Then
Return y.SerialNo.CompareTo(x.SerialNo)
Else
Return x.SerialNo.CompareTo(y.SerialNo)
End If
End Function
End Class
I get the following syntax error which I cannot figure out:
Error - Class 'CassPrintComparer2' must implement 'Function Compare(x As
MailHouse2.DataAccess.ICASSPrint, y As MailHouse2.DataAccess.ICASSPrint) As
Integer' for interface 'System.Collections.Generic.IComparer(Of ICASSPrint)'.
I just cannot see what I've done wrong. The IDE puts the squiggly error line
under IComparer(Of ICASSPrint).
Thanks, Flomo