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

 Syntax
   func uint pickflag extern
   param value _LIST pList, ;
         value uint  uItem, ;
         value uint  uBitNo

 Arguments
   pList is a list pointer.
   uItem  is a list item index.
   uBitNo is a bit position between 0 and 7.

 Return
   Status of flag bit.

 Description
   The pickflag() function returns the current status of the flag bit
   specified by uBitNo of the list item specified by uItem in the list
   specified by pList. See pick.hdr for flag values.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_pickflag
   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_pickflag()
   endproc

See Also: pickflags() picksetflag()

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