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 - picksetflag() set a flag bit of a list item http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 picksetflag()       Set a flag bit of a list item
------------------------------------------------------------------------------
 Declaration
   pick.hdr

 Syntax
   proc picksetflag extern
   param value _LIST   pList, ;
         value uint    uItem, ;
         value uint    uFlags, ;
         value logical lStatus

 Arguments
   pList is a list pointer.
   uItem is a list item index.
   uBitNo is the bit position to set.
   lStatus is the setting for the specified bit.

 Return
   None.

 Description
   The picksetflag() procedure sets the status bit specified by uBitNo of the
   item specified by uItem in the list specified by pList to the status
   specified by lStatus. See pick.hdr for status bit positions.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_picksetflag
   vardef
      _SLIST pList
      uint   i
   enddef
   pList := pickinit()
   i     := 0
   
   if findfirst( "*.*", &FIND_ANYFILE )
      repeat
         pickadd( pList, findfstr() )
         i++
   
         // If we have an EXE file, we set bit 7 in the pick list item's
         // flag byte.
         //
         if right( findfstr(), 3 ) == "EXE"
            picksetflag( pList, i, 7, .t. )
         endif
      until .not. findnext()
   
      // Display the file names in the list items, and use attribute red
      // on blue for EXE files.
      //
      savecolors()
      for i := 1 to pickcount( pList )
         if pickflag( pList, i, 7 )
            __syscolor[ CLR_STD ] := BLACK_RED
         else
            __syscolor[ CLR_STD ] := BLACK_WHITE
         endif
         ? pickstr( pList, i )
      next
      restcolors()
      ?
   endif
   pickclear( pList )
   endproc

   proc main
   Test_picksetflag()
   endproc

See Also: pickflag()

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