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


Back to Table of Contents

Copyright © 2002-2018 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. Click for license .