I wrote the following class:
Public Class CassPrintCompar er2
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.Data Access.ICASSPri nt, ByVal y
As MailHouse2.Data Access.ICASSPri nt) As Integer
If (_sortDescendin g) Then
Return y.SerialNo.Comp areTo(x.SerialN o)
Else
Return x.SerialNo.Comp areTo(y.SerialN o)
End If
End Function
End Class
I get the following syntax error which I cannot figure out:
Error - Class 'CassPrintCompa rer2' must implement 'Function Compare(x As
MailHouse2.Data Access.ICASSPri nt, y As MailHouse2.Data Access.ICASSPri nt) As
Integer' for interface 'System.Collect ions.Generic.IC omparer(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 CassPrintCompar er2
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.Data Access.ICASSPri nt, ByVal y
As MailHouse2.Data Access.ICASSPri nt) As Integer
If (_sortDescendin g) Then
Return y.SerialNo.Comp areTo(x.SerialN o)
Else
Return x.SerialNo.Comp areTo(y.SerialN o)
End If
End Function
End Class
I get the following syntax error which I cannot figure out:
Error - Class 'CassPrintCompa rer2' must implement 'Function Compare(x As
MailHouse2.Data Access.ICASSPri nt, y As MailHouse2.Data Access.ICASSPri nt) As
Integer' for interface 'System.Collect ions.Generic.IC omparer(Of ICASSPrint)'.
I just cannot see what I've done wrong. The IDE puts the squiggly error line
under IComparer(Of ICASSPrint).
Thanks, Flomo
Comment