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 - picktrim() eliminate empty items from the end of a string list http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 picktrim()          Eliminate empty items from the end of a string list
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   func logical picktrim extern
   param _SLIST pList

 Arguments
   pList is the list to modify.

 Return
   A logical indicating if the list has been changed.

 Description
   The picktrim() function deletes any empty item from the end of a
   string 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_picktrim
   vardef
      _SLIST pList
      uint   n
   enddef
   pList := ExampleList()              // create and display example list
   for n := 1 to 6
      pickadd( pList, __c_empty )      // add six empty strings
   next
   ?
   ShowList( pList )                   // show list with empty items at end
   picktrim( pList )                   // eliminate last six items
   ?
   ShowList( pList )                   // show modified list
   pickclear( pList )
   endproc

   proc main
   Test_picktrim()
   endproc

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