$FUNCNAME$
  DBSETRELATION()
$CATEGORY$
  DATABASE
$SUMMARY$
   Relate two work areas
$LANG_RU$
        
$SYNTAX$
     DBSETRELATION(<nArea> | <cAlias>, <bExpr>, <cExpr>) --> NIL
$LANG_RU$
     DBSETRELATION( < > | <>,
		    < -  >,
		    [< >] )   -->  NIL
$ARGUMENTS$
     <nArea> is a numeric value that specifies the work area number of
     the child work area.
     <cAlias> is a character value that specifies the alias of the child
     work area.
     <bExpr> is a code block that expresses the relational expression in
     executable form.
     <cExpr> is a character value that expresses the relational
     expression in textual form.
$LANG_RU$
     < > -  ,   
       .
     <> -  ,    
      .
     < -  > -  ,   
        .
     < > -   ,
           . 
     < > ,   DBRELATION() 
      .
$RETURNS$
     DBSETRELATION() always returns NIL.
$LANG_RU$
     DBSETRELATION()   NIL.
$DESCRIPTION$
     DBSETRELATION() relates the work area specified by <nArea> or <cAlias>
     (the child work area) to the current work area (the parent work area).
     Any existing relations remain active.

     Relating work areas synchronizes the child work area with the parent
     work area.  This is achieved by automatically repositioning the child
     work area whenever the parent work area moves to a new record.  If there
     is an active index in the child work area, moving the parent work area
     causes an automatic SEEK operation in the child work area; the seek key
     is based on the expression specified by <bExpr> and/or <cExpr>.  If the
     child work area has no active index, moving the parent work area causes
     an automatic GOTO in the child work area; the record number for the GOTO
     is based on the expression specified by <bExpr> and/or <cExpr>.

     The relational expression may be a code block (<bExpr>) or both a code
     block and equivalent text (<cExpr>).  If both versions are supplied,
     they must be equivalent.  If the text version is omitted, DBRELATION()
     will return an empty string for the relation.

     DBSETRELATION() performs the same function as the standard SET RELATION
     command with the ADDITIVE clause.  For more information, refer to the
     SET RELATION command.
$LANG_RU$
     DBSETRELATION() -   ,   
     < >  <> (  )  
       (  ).  
        .

           
            
     .      
           ,   
           . 
          ,  
           
       SEEK    .   
           < - 
     >.        , 
           
        GOTO    . 
         GOTO    
     < -  >.

             < - 
     >,    : < -  >  
      < >.     ,  
     DBRELATION()    .

     DBSETRELATION()    ,    
     SET RELATION   ADDITIVE.   
        SET RELATION.
$EXAMPLES$
       This example demonstrates a typical use of the DBSETRELATION()
	function:

	USE Employee NEW
	USE Department NEW INDEX Dept
	SELECT Employee
	DBSETRELATION("Department", {|| Employee->Dept},;
			"Employee->Dept")
	LIST Employee->Name, Department->Name
$LANG_RU$
       USE Employees NEW
       USE Department NEW INDEX Dept

       SELECT Employee
       DBSETRELATION("Department", {|| Employee->Dept}, "Employee->Dept")
       LIST Employee->Name, Department->Name
$SEEALSO$
  DBCLEARRELATION(),DBRELATION(),DBRSELECT(),FOUND()
$END$
