Condividi tramite


RECSIZE( ) Function

Returns the size (width) of a table record.

RECSIZE([nWorkArea | cTableAlias])

Return Values

Numeric

Parameters

  • nWorkArea
    Specifies the work area number for a table open in another work area. RECSIZE( ) returns 0 if a table isn't open in the work area you specify.
  • cTableAlias
    Specifies the table alias for a table open in another work area.

Remarks

RECSIZE( ) issued without the optional arguments nWorkArea or cTableAlias returns the record size for the table in the currently selected work area.

Example

In the following example, Microsoft Visual FoxPro compares the available disk space with the amount needed to sort customer.

** Check DISKSPACE before a SORT **

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer  && Opens Customer table

** Get size of table header **

gnTableHead = HEADER( )

** Calculate size of table **

gnFileSize = gnTableHead + (RECSIZE( ) * RECCOUNT( ) + 1)
IF DISKSPACE( ) > (gnFileSize * 3)
   WAIT WINDOW 'Sufficient diskspace to sort.'
ELSE
   WAIT WINDOW 'Insufficient diskspace. Sort cannot be done.'
ENDIF

See Also

RECCOUNT( ) | FSIZE( ) | HEADER( )