RDD

DbStruct()

Return the structure of the current database file

Syntax

Signature
DbStruct() --> aStruct

Arguments

None.

Return value

An array of field arrays containing name, type, length and decimals.

Description

DbStruct() returns the complete physical structure of the current work area. Each row describes one field in field order.

Notes

With no open area it returns an empty array.

Example

DbStruct.prg
PROCEDURE Main()

   DbCreate( "struct_demo.dbf", { { "NAME", "C", 12, 0 }, { "AGE", "N", 3, 0 } } )
   DbUseArea( .T., , "struct_demo.dbf", "Demo" )
   QOut( "Fields: " + LTrim( Str( Len( DbStruct() ) ) ) )
   DbCloseArea()
   FErase( "struct_demo.dbf" )

RETURN

Output

See also