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 - pickisactive() return the active status of a list item http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 pickisactive()      Return the active status of a list item
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   func logical pickisactive extern
   param value _LIST pList, ;
         value uint  uItem

 Arguments
   pList is a list pointer.
   uItem is a list item index.

 Return
   A logical indicating if the list item is active.

 Description
   This function returns .t. if the specified list item is active (the
   default), or .f. if it is not active.

   This function is normally used with string lists to be displayed via the
   pickdisp() function.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc SaveFile static
   ? "Saving file..."
   endproc
   
   proc Test_pickisactive
   vardef
      _SLIST  pList
      logical lFileOpen
   enddef
   pList := FileMenu()
   
   // deactivate non-appropriate menu items
   //
   // lFileOpen := .f. // commented out so value of lFileOpen is accidental
   if .not. lFileOpen
      picksetact( pList, 4, .f. )
      picksetact( pList, 5, .f. )
      picksetact( pList, 7, .f. )
   endif
   // do actions here
   if pickisactive( pList, 4 )
      SaveFile()
   endif
   pickclear( pList )
   endproc

   proc main
   Test_pickisactive()
   endproc

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