[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|             RECSIZE             |
+---------------------------------+
RECSIZE([<expN> | <expC>])

-----------------------------------
Returns size of database record.
Return value - Numeric
-----------------------------------

RECSIZE() returns the size (width) of a database record.

<expN> | <expC>
        If you don't specify a work area or alias, RECSIZE() returns the record
size for the database file in the currently selected work area.

        To return the record size for a database open in another work area,
include the work area number <expN>, or the database alias <expC>.

        If a database isn't open in the work area you specify, RECSIZE()
returns zero.  If a database doesn't have the alias you specify, the
message "Alias not found" is displayed.

+---------------------------------+
|         Program Example         |
+---------------------------------+
In this example, FoxPro compares available diskspace with that needed to
carry out given action and responds accordingly.

*** Check DISKSPACE before a SORT ***
USE customer
*** Get size of database header ***
dbf_top = HEADER()
*** Calculate size of database ***
file_size = dbf_top + (RECSIZE() * RECCOUNT() + 1)
IF DISKSPACE() > (file_size * 3)
   @ 5,0 SAY 'Sufficient diskspace to sort.'
ELSE
   @ 5,0 SAY 'Insufficient diskspace. Sort cannot be done.'
ENDIF

-----------------------------------

See Also:  FSIZE(), RECCOUNT()

-----------------------------------

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