$FUNCNAME$
  DBSTRUCT()
$CATEGORY$
  DATABASE
$SUMMARY$
   Create an array containing the structure of a database file
$LANG_RU$
    ,      .
$SYNTAX$
     DBSTRUCT() --> aStruct
$LANG_RU$
     DBSTRUCT() -> ,  
$RETURNS$
     DBSTRUCT() returns the structure of the current database file in an
     array whose length is equal to the number of fields in the database
     file.  Each element of the array is a subarray containing information
     for one field.  The subarrays have the following format:

     <PRE>DBSTRUCT() Return Array
     ------------------------------------------------------------------------
     Position     Metasymbol     dbstruct.ch
     ------------------------------------------------------------------------
     1            cName          DBS_NAME
     2            cType          DBS_TYPE
     3            nLength        DBS_LEN
     4            nDecimals      DBS_DEC
     ------------------------------------------------------------------------
     </PRE>

     If there is no database file in USE in the current work area, DBSTRUCT()
     returns an empty array ({}).
$LANG_RU$
     DBSTRUCT()        
     ,       .  
       ,     .
        :

     <PRE>,   DBSTRUCT().
     ---------------------------------------------------------------------
                    dbstruct.ch
     ---------------------------------------------------------------------
       1            cName            DBS_NAME
       2            cType            DBS_TYPE
       3            nLength          DBS_LEN
       4            nDecimals        DBS_DEC
     ---------------------------------------------------------------------
     </PRE>

             , 
     DBSTRUCT()   ({}) .
$DESCRIPTION$
     DBSTRUCT() is a database function that operates like COPY STRUCTURE
     EXTENDED by creating an array of structure information rather than a
     database file of structure information.  There is another function,
     DBCREATE(), that can create a database file from the structure array.

     By default, DBSTRUCT() 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 as shown below.

     Note, a header file, dbstruct.ch, located in \include contains a
     series of manifest constants for each field attribute.
$LANG_RU$
     DBSTRUCT() -      , 
       COPY STRUCTURE EXTENDED.    
         ,   -   .  
       DBCREATE(),       
         .

       DBSTRUCT()    () 
     .         ,
         ,  ,   .

           xClipper  
      dbstruct.ch,    \include, 
           .
$EXAMPLES$
       This example opens two database files and then creates an
	array containing the database structure using DBSTRUCT() within an
	aliased expression.  The field names are then listed using AEVAL():

	#include "dbstruct.ch"
	//
	LOCAL aStruct
	USE Customer NEW
	USE Invoices NEW
	//
	aStruct := Customer->(DBSTRUCT())
	AEVAL( aStruct, {|aField| QOUT(aField[DBS_NAME])} )
$LANG_RU$
                
       DBSTRUCT()  ,    . 
         ,  . ,  
        AEVAL(),    :


       #include "dbstruct.ch"
       //
       LOCAL aStruct
       USE Customer NEW
       USE Invoices NEW
       //
       aStruct := Customer->(DBSTRUCT())
       AEVAL( aStruct, { |aField| QOUT(aField[DBS_NAME]) } )
$SEEALSO$
  AFIELDS()
$END$
