|
of_setfilter
|
|
Full name
|
pfc_n_cst_dwsrv_filter.of_setfilter
|
Access
|
public
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_setfilter(string)
|
Name
|
Datatype
|
li_rc
|
integer
|
lnv_filterattrib
|
n_cst_filterattrib
|
lnv_return
|
n_cst_returnattrib
|
public function integer of_setfilter (string as_format);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_SetFilter
//
// Access: Public
//
// Arguments:
// as_format: A filter expression. When Null, invokes a Specify Filter
// dialog.
//
// Returns: Integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description: Set a datawindow filter or open a Specify Filter dialog.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Use of constants within services.
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
integer li_rc
n_cst_returnattrib lnv_return
n_cst_filterattrib lnv_filterattrib
// Check the datawindow reference.
If IsNull(idw_requestor) Or Not IsValid(idw_requestor) Then Return -1
// Passed argument was Null (as_format is null),
// call the appropriate SetSort Dialog.
IF Not IsNull (as_format) THEN
Return idw_Requestor.SetFilter (as_format)
END IF
// Passed argument was null, so call filter dialog.
CHOOSE CASE ii_style
CASE DEFAULT
// Powerscript default filter style (Default)
li_rc = idw_requestor.SetFilter (as_format)
// Check if the dialog was close via the Cancel button (=-1).
If li_rc = -1 Then li_rc = 0
is_filterin = ''
is_filterout = ''
Return li_rc
CASE EXTENDED, SIMPLE
// Set up the filter information to be passed to the dialog.
IF of_BuildFilterAttrib(lnv_filterattrib) <> 1 THEN Return -1
lnv_filterattrib.idw_dw = idw_Requestor
IF ii_style = EXTENDED THEN
OpenWithParm(w_filterextended, lnv_filterattrib)
ELSE
// PFC Simple Filter
OpenWithParm(w_filtersimple, lnv_filterattrib)
END IF
// Get the return PowerObject.
lnv_return = Message.PowerObjectParm
// Check if the dialog was close via the Cancel button.
IF lnv_return.ii_rc <> 1 Then Return lnv_return.ii_rc
li_rc = idw_Requestor.SetFilter (lnv_return.is_rs)
If li_rc > 0 Then
is_filterin = lnv_return.is_rs
is_filterout = of_GetFilter()
End If
Return li_rc
END CHOOSE
// Invalid option.
Return -1
end function