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 - pickchg() replace a string list item http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 pickchg()           Replace a string list item
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   proc pickchg extern
   param value _SLIST pList, ;
         value uint   uItem, ;
         const char   cString

 Arguments
   pList is a list pointer.
   uItem is the number of the item to modify.
   cString is a string to place in the list.

 Return
   None.

 Description
   The pickchg() function replaces an existing string item in a
   string list. The length of the new string must match the length of
   the previous one.

   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

   // Replace a string in a list while making sure the new string is not
   //  longer than the original one
   
   proc Test_pickchg
   vardef
      _SLIST pList
      uint   nLength
      uint   n
      char   cString
   enddef
   pList := ExampleList()
   ?
   accept "Type a string  " to cString
   pickchg( pList, 3, substr( cString, 1, listitemlen( pList, 3 ) ) )
   ?
   ? "List item 3 has been replaced with your string"
   ?
   ShowList( pList )
   pickclear( pList )
   endproc

   proc main
   Test_pickchg()
   endproc

See Also: pickreplace()

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