[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 HEADER()
 Return the current database file header length
------------------------------------------------------------------------------
 Syntax

     HEADER() --> nBytes

 Returns

     HEADER() returns the number of bytes in the header of the current
     database file as an integer numeric value.  If no database file is in
     use, HEADER() returns a zero (0).

 Description

     HEADER() is a database function that is used with LASTREC(), RECSIZE(),
     and DISKSPACE() to create procedures for backing up files.

     By default, HEADER() operates on the currently selected work area.  It
     will operate on an unselected work area if you specify it as part of an
     aliased expression (see example below).

 Examples

     .  This example determines the header size of Sales.dbf:

        USE Sales NEW
        ? HEADER()            // Result: 258

     .  This example defines a pseudofunction, DbfSize(), that uses
        HEADER() with RECSIZE() and LASTREC() to calculate the size of the
        current database file in bytes:

        #define DbfSize()      ((RECSIZE() * LASTREC()) + ;
              HEADER() + 1)

        Later you can use DbfSize() as you would any function:

        USE Sales NEW
        USE Customer NEW
        ? DbfSize()
        ? Sales->(DbfSize())

 Files   Library is EXTEND.LIB.


See Also: DISKSPACE() LASTREC() RECSIZE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson