$FUNCNAME$
  DBRSELECT()
$CATEGORY$
  DATABASE
$SUMMARY$
   Return the target work area number of a relation
$LANG_RU$
         .
$SYNTAX$
     DBRSELECT(<nRelation>) --> nWorkArea
$LANG_RU$
     DBRSELECT(< >) -->   
$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$
     DBRSELECT() returns the work area number of the relation specified by
     <nRelation> as an integer numeric value.  If there is no RELATION SET
     for <nRelation>, DBRSELECT() returns zero.
$LANG_RU$
     DBRSELECT()        
      ,     < >.
           , DBRSELECT()
      .
$DESCRIPTION$
     DBRSELECT() is a database function used in combination with DBRELATION()
     to determine the work area and linking expression of an existing
     relation created with the SET RELATION command.  DBRSELECT() returns the
     work area defined by the INTO clause.  DBRELATION() returns the linking
     expression defined by the TO clause.  To determine the alias of the
     relation instead of the work area number, use the expression
     ALIAS(DBRSELECT(<nRelation>)).

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

       DBRSELECT()    (  ) 
     .        . 
        DBRSELECT()  ,  
     (  ).
$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, as well as the target work
	area of the relation:

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

	? ALIAS(DBRSELECT(2))               // Result: BACKORDER

       Later, you can query the same information from an unselected
	work area by using an aliased expression:

	USE Archive NEW
	? Customer->(DBRELATION(2))      // Result: OrderNum
	? Customer->(DBRSELECT(2))         // Result: 3
$LANG_RU$
           ,  
               
              
             :

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

               
        ,  ,  :

       USE Archive NEW
       ? Customer->(DBRELATION(2))           // : OrderNum
       ? Customer->(DBRSELECT(2))            // : 3
$SEEALSO$
  DBFILTER(),DBRELATION(),RLOCK()
$END$
