LIST.Sort

Previous  Next

 

count = LIST.Sort( lid       AS HANDLE,

                   itx       AS INTEGER, [=0]

                   ascending AS INTEGER [=TRUE] ) AS INTEGER

 

count = LIST.Sort( lid       AS HANDLE,

                   item      AS STRING,

                   ascending AS INTEGER [=TRUE] ) AS INTEGER

 


 

Sorts the List in either ascending or descending order using the Item specified by the itx argument.  If itx is omitted, then first Item is used.  The Item can also referred to by its name.  The function returns the number of items sorted.  If failed, the count is less than size.

 

Example:

 

DIM hList AS HANDLE

 

hList = LIST.Create( "Kalle", STRING, "Nisse", REAL, 4 )

 

LIST.At( hList, 0, 0, "Kalle Anka      " )

LIST.At( hList, 0, 1, 1.234 )

LIST.At( hList, 1, 0, "Kajsa Anka      " )

LIST.At( hList, 1, 1, 2.345 )

LIST.At( hList, 2, 0, "Joakim von Anka " )

LIST.At( hList, 2, 1, 3.456 )

LIST.At( hList, 3, 0, "Farmor Anka     " )

LIST.At( hList, 3, 1, 4.567 )

 

' Sort the List in Ascending Order

 

LIST.Sort( hList, "Kalle" )