[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 Determine the record length of a database (.dbf) file

     RECSIZE() --> nBytes


     RECSIZE() returns, as a numeric value, the record length in bytes of the
     database file open in the current work area.  RECSIZE() returns zero if
     no database file is open.


     RECSIZE() is a database function that determines the length of a record
     by summing the lengths of each field then adding one for the DELETED()
     status flag.  When this value is multiplied by LASTREC(), the product is
     the amount of space occupied by the file's records.

     RECSIZE() is useful in programs that perform automatic file backup.
     When used in conjunction with DISKSPACE(), the RECSIZE() function can
     assist in ensuring that sufficient free space exists on the disk before
     a file is stored.

     By default, RECSIZE() 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).


     .  The following user-defined function, DbfSize(), uses RECSIZE()
        to calculate the size of the current database file:

        FUNCTION DbfSize
           RETURN ((RECSIZE() * LASTREC()) + HEADER() + 1)

     .  This example illustrates the use of RECSIZE() to determine the
        record length of database files open in unselected work areas:

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

 Files   Library is EXTEND.LIB.

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson