$FUNCNAME$
  DBRELATION()
$CATEGORY$
  DATABASE
$SUMMARY$
   Return the linking expression of a specified relation
$LANG_RU$
       .
$SYNTAX$
     DBRELATION(<nRelation>) --> cLinkExp
$LANG_RU$
     DBRELATION(< >) -->  
$ARGUMENTS$
     <nRelation> is the position of the desired relation in the list of
     current work area relations.  The relations are numbered according to
     the order in which they were defined with SET RELATION.
$LANG_RU$
     < > -      
       .     
        SET RELATION.
$RETURNS$
     DBRELATION() returns a character string containing the linking
     expression of the relation specified by <nRelation>.  If there is no
     RELATION SET for <nRelation>, DBRELATION() returns a null string ("").
$LANG_RU$
     DBRELATION()   ,  
      ,     <
     >.        ,
     DBRELATION()     ("").
$DESCRIPTION$
     DBRELATION() is a database function used with DBRSELECT() to determine
     the linking expression and work area of an existing relation created
     with the SET RELATION command.

     DBRELATION() returns the linking expression defined by the TO clause.
     DBRSELECT() returns the work area linked as defined by the INTO clause.

     By default, DBRELATION() 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).
$LANG_RU$
     DBRELATION() -      , 
          DBRSELECT()  
           ,
       SET RELATION. DBRELATION() 
      ,    TO.

     DBRSELECT()     ,  
         INTO.

       DBRELATION()    (  )
      .       
         DBRELATION()  , 
      (    ).
$EXAMPLES$
       This example opens three database files, sets two child
	relations from the parent work area, and then displays the linking
	expression to the second child work area:

	USE Invoices INDEX Invoices NEW
	USE BackOrder INDEX BackOrder NEW
	USE Customer INDEX Customer NEW
	SET RELATION TO CustNum INTO Invoices, OrderNum ;
	      INTO BackOrder
	//
	? DBRELATION(2)                  // Result: OrderNum

       Later you can query the same linking expression from an
	unselected work area by using an aliased expression like this:

	USE Archive NEW
	? Customer->(DBRELATION(2))   // Result: OrderNum

       This example is a user-defined function, Relation(), that
	returns the results of both DBRELATION() and DBRSELECT() as an array:

	FUNCTION Relation( nRelation )
	   RETURN { DBRELATION(nRelation), ;
		 ALIAS(DBRSELECT(nRelation)) }
$LANG_RU$
             , 
                
         ,     
       :

       USE Invoices INDEX Invoices NEW
       USE BackOrder INDEX BackOrder NEW
       USE Customer INDEX Customer NEW
       SET RELATION TO CustNum INTO Invoices, OrderNum INTO BackOrder
       //
       ? DBRELATION(2)                       // : OrderNum

              
        ,  ,  :

       USE Archive NEW
       ? Customer --> (DBRELATION(2))        // : OrderNum

           Relation() 
         DBRELATION()  DBRSELECT()   :

       FUNCTION Relation( nRelation )
	  RETURN { DBRELATION(nRelation), ALIAS(DBRSELECT(nRelation)) }
$SEEALSO$
  DBFILTER(),DBRSELECT()
$END$
