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

 Syntax
   func uint pickflags extern
   param value _LIST pList, ;
         value uint  uItem

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

 Return
   Status of flag byte.

 Description
   The pickflags() function returns the current status of the flag byte
   for a list item.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_pickflags
   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 testbit( pickflags( 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_pickflags()
   endproc

See Also: pickflag() picksetflags()

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