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 - pickclear() release memory allocated for a list http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 pickclear()         Release memory allocated for a list
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   proc pickclear extern
   param value _LIST pList

 Arguments
   pList is a list pointer.

 Return
   None.

 Description
   pickclear() releases the memory allocated for the list specified with
   pList. After calling pickclear() the list is no longer valid. Calls
   to other list functions with the value of pList will result in a runtime
   error.

   The pickclear() function should be called as soon as a list is
   no longer needed, to free dynamic memory for other purposes; this is
   extremely important if list structures are created within program
   loops.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_pickclear
   // Initialize and execute a "file" sub-menu with hot-keys, and release
   // the list after execution of the picklistx() function.
   vardef
      _SLIST pList
      uint   uChoice
   enddef
   clear
   ? "Memory", istr( coreleft() )
   pList := FileMenu()                            // allocate list
   ? "Memory", istr( coreleft() )
   uChoice := pickdisp( pList, 5, 5, 14, 14 )     // execute menu
   @ 16, 0
   ? "Memory", istr( coreleft() )
   pickclear( pList )                             // release the list memory
   ? "Memory", istr( coreleft() )
   endproc

   proc main
   Test_pickclear()
   endproc

See Also: pickinit()

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