Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.2 . The Guide To CA-Clippe - <b>recsize()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 RECSIZE()
 Determine the record length of a database (.dbf) file
------------------------------------------------------------------------------
 Syntax

     RECSIZE() --> nBytes

 Returns

     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.

 Description

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

 Examples

     .  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.

See Also: DISKSPACE() FIELDNAME() HEADER() LASTREC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson