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 - barrfill() fill a bit array http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 barrfill()          Fill a bit array
------------------------------------------------------------------------------
 Declaration
   bit.hdr

 Syntax
   proc barrfill extern
   param value _BITARRAY nArrayHandle, ;
         value ulong     nElements, ;
         value logical   lSet

 Arguments
   nArrayHandle is a bit array handle.

   nElements is the number of elements to change.

   lSet is a flag to indicate if bits will be set.

 Return
   None.

 Description
   The barrfill() procedure sets or resets the given number of elements
   in a bit array, starting from the first element.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_barrfill
   vardef
      _BITARRAY pArr
      uint      n
   enddef
   pArr := barrinit( 10000, .f. )   // allocate bit array
   for n := 9005 to 9015            // display a range of bits
      ? n, barrget( pArr, n )
   next
   ?
   barrfill( pArr,  9010, .t. )     // set elements
   for n := 9005 to 9015            // display a range of bits
      ? n, barrget( pArr, n )
   next
   ?
   barrclear( pArr )                // free array
   endproc

   proc main
   Test_barrfill()
   endproc

See Also: barrset()

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