$FUNCNAME$
  DBFILTER()
$CATEGORY$
  DATABASE
$SUMMARY$
   Return the current filter expression as a character string
$LANG_RU$
          .
$SYNTAX$
     DBFILTER() --> cFilter
$LANG_RU$
     DBFILTER() -->  
$RETURNS$
     DBFILTER() returns the filter condition defined in the current work area
     as a character string.  If no FILTER has been SET, DBFILTER() returns a
     null string ("").
$LANG_RU$
     DBFILTER()   ,   
          .    ,
     DBFILTER()     ("").
$DESCRIPTION$
     DBFILTER() is a database function used to save and re-execute an active
     filter by returning the filter expression as a character string that can
     be later recompiled and executed using the macro operator (&amp;).  This
     function operates like the DBRELATION() and DBRSELECT() functions which
     save and re-execute the linking expression of a relation within a work
     area.

     Since each work area can have an active filter, DBFILTER() can return
     the filter expression of any work area.  This is done by referring to
     DBFILTER() within an aliased expression as demonstrated below.
$LANG_RU$
     DBFILTER() -      ,  
            
       ,   , 
            
         (&amp;).    
      DBRELATION()  DBRSELECT(),   
          
        .      
      , DBFILTER()      
     .     DBFILTER()  ,
      ,   .
$EXAMPLES$
       This example opens two database files, sets two filters, and
	then displays the filter expressions for both work areas:

	USE Customer INDEX Customer NEW
	SET FILTER TO Last = "Smith"
	USE Invoices INDEX Invoices NEW
	SET FILTER TO CustId = "Smi001"
	SELECT Customer
	//
	? DBFILTER()                      // Result: Last = "Smith"
	? Invoices->(DBFILTER())      // Result: Custid = "Smi001"

       This user-defined function, CreateQry(), uses DBFILTER() to
	create a memory file containing the current filter expression in the
	private variable cFilter:

	FUNCTION CreateQry( cQryName )
	   PRIVATE cFilter := DBFILTER()
	   SAVE ALL LIKE cFilter TO (cQryName + ".qwy")
	   RETURN NIL

       You can later RESTORE a query file with this user-defined
	function, SetFilter():

	FUNCTION SetFilter()
	PARAMETER cQryName
	   RESTORE FROM &amp;cQryName..qwy ADDITIVE
	   SET FILTER TO &amp;cFilter.
	   RETURN NIL
$LANG_RU$
            ,  
                
        :

       USE Customer INDEX Customer NEW
       SET FILTER TO Last = "Smith"
       USE Invoices INDEX Invoices NEW
       SET FILTER TO CustId = "Smi001"
       SELECT Customer
       //
       ? DBFILTER()                 // : Last = "Smith"
       ? Invoices->(DBFILTER())     // : CustId = "Smi001"

           CreateQry()
        DBFILTER()     
       ,      PRIVATE 
       cFilter:

       FUNCTION CreateQry( cQryName )
	  PRIVATE cFilter := DBFILTER()
	  SAVE ALL LIKE cFilter TO ( cQryName + ".qwy")
	  RETURN NIL

             
       SetFilter() :

       FUNCTION SetFilter( cQryName )
	  RESTORE FROM &amp;cQryName..qwy ADDITIVE
	  SET FILTER TO &amp;cFilter.
	  RETURN NIL
$SEEALSO$
  DBRELATION(),DBRSELECT()
$END$
