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 - _bitarray bit array pointer http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _BITARRAY           Bit array pointer
------------------------------------------------------------------------------
 Declaration
   bit.hdr

 Syntax
   typedef ulong _BITARRAY

 Description
   The _BITARRAY type is used to declare a pointer to a bit array.
   A bit array pointer is returned by the barrinit() function, and used
   by the other bit array functions.

 Example
   #define EXAMPLE_TYPE
   #include example.hdr

   proc Test_BITARRAY
   vardef
      _BITARRAY pArr
   enddef
   // allocate and access array of half a million elements
   pArr := barrinit( 500000UL, .f. )
   ? barrget( pArr, 76541UL )          // print .f.
   ? barrget( pArr, 76542UL )          // print .f.
   ? barrget( pArr, 76543UL )          // print .f.
   barrset(   pArr, 76542UL, .t. )     // set an element
   ?
   ? barrget( pArr, 76541UL )          // print .f.
   ? barrget( pArr, 76542UL )          // print .t.
   ? barrget( pArr, 76543UL )          // print .f.
   barrclear( pArr )                   // free array
   endproc

   proc main
   Test_BITARRAY()
   endproc

See Also: barrinit()

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