Re: GetFilter
Brought to you by:
jeffmurphy
|
From: Joel M. <jm...@cn...> - 1997-01-13 17:30:41
|
actually there is an undocumented function called ars_perl_Qualifier
that expands a qualifier structure into a hash of sorts. I added it
when working on a web interface, but forgot about it.
$h = ars_perl_Qualifier($q);
print join(",",%$h);
the c structure looks like this:
typedef struct ARQualifierStruct {
unsigned int operation;
union {
struct {
struct ARQualifierStruct *operandLeft;
struct ARQualifierStruct *operandRight;
} andor;
struct ARQualifierStruct *not;
ARRelOpStruct *relOp;
} u;
} ARQualifierStruct;
the hash returned by ars_perl_qualifier has the members:
oper = "and", "or", "not", "rel_op"
left = qualifier (only for and, or)
right = qualifier (only for and, or)
not = qualifier (only for not)
rel_op = rel_op (only for rel_op)
a rel_op is:
oper = "==", ">", ">=", "<", "<=", "!=", "like", "in"
left = FieldValueOrArithStruct
right = FieldValueOrArithStruct
FieldValueOrArithStruct is:
fieldId = integer
value = scalar value (integer, string, float, etc.)
arith = ArithOpStruct
statHistory = StatHistoryValue
valueSet = list of scalar values
variable = integer /* I think this is for passing
macro arguments */
queryValue = QueryValueStruct
queryCurrent = integer
...and I don't have time to keep going right now. You probably don't
want to have to walk this expression tree anyways.
You might want to try this instead:
ars_Export($c, "Filter", $filter_name)
and look at the text it gives you.
> >Example output:
> >
> > Query: ARQualifierStructPtr=SCALAR(0x181498)
> >
>
>
> the qualifier field is not available as plain-text. it is a compiled
> field that arsperl doesnt decode.
>
> when you do
>
> $q = ars_LoadQualifier(..., "'Login name' = \"bart\"");
>
> this compiles the qualification 'Login name' = "bart" into $q.
> once done, arsperl can not decode it. when you print the Qualifier and
> see the above output, what you are really printing is the address of
> the compiled qualifier (which is stored with filters and active links).
>
> jeff
>
|