home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / listx / csort.cls < prev    next >
Encoding:
Text File  |  1997-11-11  |  683 b   |  28 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "CSort"
  6. Attribute VB_Creatable = False
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public NumericSort As Boolean
  11. Public Function IMSort_CompareColumns(item1 As String, item2 As String, col As Integer) As Integer
  12.    '
  13.    ' Compare items either as integer or string
  14.    '
  15.    If (NumericSort = True) Then
  16.       IMSort_CompareColumns = CInt(item1) - CInt(item2)
  17.    Else
  18.       If (item1 < item2) Then
  19.          IMSort_CompareColumns = -1
  20.       ElseIf (item1 > item2) Then
  21.          IMSort_CompareColumns = 1
  22.       Else
  23.          IMSort_CompareColumns = 0
  24.       End If
  25.    End If
  26. End Function
  27.  
  28.