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 - pickexchange() exchange two items in a string list http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 pickexchange()      Exchange two items in a string list
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   func logical pickexchange extern
   param       _SLIST pList, ;
         value uint   uItem1, ;
         value uint   uItem2

 Arguments
   pList is the list to manipulate.
   uItem1 is the first item to exchange.
   uItem2 is the second item to exchange.

 Return
   A logical indicating the success of operation.

 Description
   The pickexchange() function exchanges two items in a string list.

   Note that the whole list is copied during the operation, the original list
   is cleared, and its pointer is replaced with the new list's pointer.
   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_pickexchange
   vardef
      _SLIST pList
   enddef
   pList := ExampleList()
   ?
   pickexchange( pList, 4, 5 )       // exchange items 4 and 5
   ShowList( pList )
   pickclear( pList )
   endproc

   proc main
   Test_pickexchange()
   endproc

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