Xbasic
A5_COMBINE_FILTERS Function
Syntax
New_Filter as C = a5_combine_filters(C filter1 ,C filter2 [,L flatten [,L sqlsyntax ]])
Arguments
- filter1
A character filter expression that evaluates to a logical value and selects records.
- filter2
A character filter expression that evaluates to a logical value and selects records.
- flatten
Logical. Optional. Default = .F. .T. = calls the FLATTENQUERY()function after combining filters .F. = just combine the filters
- sqlsyntax
Logical
Description
Takes two filters, either of which is sub-selected, and combines into a single filter expression
Discussion
The A5_COMBINE_FILTERS() function combines two filter expressions into a single expression.
This example just combines two filter expressions.
dim fil1 as C dim fil2 as C dim fil3 as C fil1 = "customer->lastname > 'A'" fil2 = "customer->bill_state_region > 'MA'" fil3 = a5_combine_filters(fil1, fil2, .f.) ? fil3 -> "(customer->lastname > 'A') .and. (customer->bill_state_region > 'MA')"
This example also calls the FLATTENQUERY() function.
dim fil1 as C dim fil2 as C dim fil3 as C fil1 = "customer->lastname > 'A'" fil2 = "customer->bill_state_region > 'MA'" fil3 = a5_combine_filters(fil1, fil2, .t.) ? fil3 -> "flattenquery((customer->lastname > 'A') .and. (customer->bill_state_region > 'MA'))"
See Also