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 - header() return size of header for current alias http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 header()            Return size of header for current alias
------------------------------------------------------------------------------
 Declaration
   database.hdr

 Syntax
   func uint header extern

 Arguments
   None.

 Return
   The header size of the curret alias.

 Description
   The header() functions returns the size of the header for the current
   database.

   This function can be used together with the recsize(), or arecsize() and
   reccount(), or areccount() functions to calculate the required disk space
   of a database file.

 Example
   #define EXAMPLE_DATABASE
   #include example.hdr

   proc Test_header
   open sTest
   //  Show the size of the current database file.
   ? "File size", header() + reccount() * recsize()
   /*
   The database header stores 32 bytes of information
   per field. It also has a 32 byte "descriptor".
   Therefore, the header size divided by 32 equals
   the max number of fields in the database.
   (NOTE: Some fields may have been removed and
   are not active.)
   */
   ? "Fields in header:", header() / 32 - 1
   endproc

   proc main
   Test_header()
   endproc

See Also: aheader() reccount() recsize()

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