Skip to content

Latest commit

 

History

History
31 lines (22 loc) · 1.12 KB

s4g195.md

File metadata and controls

31 lines (22 loc) · 1.12 KB

HEADER()

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()