sx_DBFilter

<< Click to Display Table of Contents >>

Navigation:  Apollo API Listing >

sx_DBFilter

VB Declaration

Declare Function sx_DBFilter Lib "Apollo9.dll" () As String

C Declaration

LONG FAR PASCAL sx_DBFilter (VOID);

Description

Extracts the current filter conditional expression. If there is no filter set but there is a query set with sx_Query, the query expression is returned instead.

Return Value

The conditional xBase expression is returned as a string. A NULL string is returned if there is no active filter or active query.

VB Example

' User filter setting

Sub bFilter_Click ()

Dim lRecNum As Long

Dim cString As String

 

If Not FilterOn Then

cString = sx_FilterDlg(sxtest.hWnd, "STATE = 'CA'")

If Len(sx_DBFilter()) > 0 Then

FilterOn = True

End If

 

If FilterOn Then

bFilter.Caption = "&Reset"

End If

Else

' clear query

FilterOn = False

bFilter.Caption = "&Filter"

lRecNum = sx_Query(0&)

End If

End Sub

C Example

void CNamesForm::OnButtonFilter()

{

sx_FilterDlg(GetParent(), "STATE = 'CA'"));

 

// test if user set filter

if (lstrlen(sx_DBFilter()))

bFilterOn = TRUE;

...

}

See Also

sx_FilterDlg, sx_SetFilter, sx_Query