Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - picksort() sort a string list http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 picksort()          Sort a string list
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   func logical picksort extern
   param _SLIST pList

 Arguments
   pList is the list to sort.

 Return
   A logical indicating the success of operation.

 Description
   The picksort() function sorts the contents of a string list in ascending
   alphabetical order. Note that picksort() effectively replaces the
   string list; the unsorted list is discarded and its handle is replaced
   by the handle of the sorted list.

   This function can only be used with string lists, but not with generic
   lists that contain non-character data.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_picksort
   vardef
      _SLIST pList
      uint   n
   enddef
   pList := pickinit()
   for n := 0 to 11
      pickadd( pList, __monthnames[ n ] )
      ? pickstr( pList, n )
   next
   ? "---------------> press a key"
   getkey()
   ?
   picksort( pList )                 // sort list
   ShowList( pList )
   pickclear( pList )
   endproc

   proc main
   Test_picksort()
   endproc

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson