Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

This function tells you the size of a table header. The header contains definition information for the table.

Usage

nHeaderSize = HEADER( [ cAlias | nWorkArea ] )

You can get the header size of any open table by passing the alias or work area. Visual FoxPro tables have much larger headers than tables from older versions of FoxPro. For details on header contents, see “DBF, FPT, CDX, DBC—Hike!”

You can combine the result of HEADER() with record size information from RECSIZE() and the record count from RECCOUNT() to determine the space requirements of a table.

Example

CREATE TABLE Test (CharFld C(1),NumFld N(1))
? HEADER()      && Returns 360

* Determine space requirements for Customer:
* Header length plus the size of one record, times
* the number of records, plus one byte for a
* terminating Ctrl+Z if any records exist.
USE Customer
nSpaceNeeded = HEADER() + RECCOUNT() * RECSIZE() + ;
    SIGN(RECCOUNT())

See Also

AFields(), FCount(), FSize(), RecCount(), RecSize()