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

 Syntax
   proc picksetflags extern
   param value _LIST pList, ;
         value uint  uItem, ;
         value uint  uFlags

 Arguments
   pList is a list pointer.
   uItem is a list item index.
   uFlags is the new value for the item flag byte.

 Return
   None.

 Description
   The picksetflags() function sets the status byte of a list item.

 Example
   #define EXAMPLE_LIST
   #include example.hdr

   proc Test_picksetflags
   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"
            picksetflags( pList, i, ;
                          or( pickflags( pList, i ), 0x80 ) )
         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_picksetflags()
   endproc

See Also: pickflags()

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