How to sort a fieldlist?

How to sort a fieldlist?

Post by Worse » Thu, 24 Jun 1999 04:00:00



hi...
anyone knows how to sort a fieldlist?

lets say i have a text-field which contains several names like this:

John One
Mary Two
Sven Three
Fred Four


Fred Four
John One
Mary Two
Sven Three

any hints?

thanks in advance
Worsel

 
 
 

How to sort a fieldlist?

Post by Mano » Thu, 24 Jun 1999 04:00:00


Sub Click(Source As Button)

     Dim sortlist                   As Variant
     Dim Swap                    As Variant
     Dim transfer                As Variant
     Dim i                              As Integer
     Dim tmp                       As String
     Dim workspace        As New NotesUIWorkspace
     Dim uidoc                   As NotesUIDocument
     Dim doc                       As NotesDocument

     Set uidoc                    = workspace.CurrentDocument
     Set doc                       = uidoc.Document
     Sortlist = doc.ListeMots   ' Name of your variable to sort
 ' S'il n'y a qu'un lment, pas besoin de trier
     If Ubound (sortlist) > 0 Then
          swap = True
          Do While swap
               swap = False
               For i = Lbound (sortlist) To (Ubound(sortlist) -1)
                    If sortlist (i) > sortlist (i + 1) Then
                         tmp = sortlist (i)
                         sortlist (i) = sortlist ( i + 1)
                         sortlist ( i +1 ) = tmp
                         swap = True
                    End If
               Next
          Loop
     End If

     doc.ListeMots = sortlist  'replace your list by the sort one

End Sub

>hi...
>anyone knows how to sort a fieldlist?

>lets say i have a text-field which contains several names like this:

>John One
>Mary Two
>Sven Three
>Fred Four


>Fred Four
>John One
>Mary Two
>Sven Three

>any hints?

>thanks in advance
>Worsel


 
 
 

How to sort a fieldlist?

Post by Worse » Fri, 25 Jun 1999 04:00:00


works great!
thank you very much! :)

Worsel

 
 
 

How to sort a fieldlist?

Post by Werner ENN » Fri, 25 Jun 1999 04:00:00


hi worsel,

you could have a view do the work for you:
just create a view that displays the field's values in a sorted column,
then dblookup it from an action button ...

regards,
werner


> hi...
> anyone knows how to sort a fieldlist?

> lets say i have a text-field which contains several names like this:

> John One
> Mary Two
> Sven Three
> Fred Four


> Fred Four
> John One
> Mary Two
> Sven Three

> any hints?

> thanks in advance
> Worsel