Hi Roger & all you other folks,

I just wanted to give you a little update on the Query/Filter issue, in
the hope that you can confirm my experimental findings ;-)

It seems that the use of Filter marks (FilterGroupMarker token), although
its whys and hows are rather badly documented, is crucial for complex
filter expressions. It obviously is not sufficient to just use nested
groups.

In my case I had to implement the following expression (the letters
represent tests on the From and To fields):

(a OR b OR c) OR ((d OR e OR f) AND (g OR h OR i))

My first attempt was to just use nested FilterGroupBegin and
FilterGroupEnd tokens, i.e. (abbreviated for clarity):

Begin/OR
Begin/OR
a
b
c
End
Begin/AND
Begin/OR
d
e
f
End
Begin/OR
g
h
i
End
End
End

This worked, but when I viewed the executed query in the GW client's
search dialog, it turned out that there were no parentheses anywhere in
the expression, so what was executed was in effect

a OR b OR c OR d OR e OR f AND g OR h OR i

which, of course, is not what was required.

When I inserted markers into the code, i.e.:

Begin/OR
Begin/OR
a
b
c
End

---> Marker/OR

Begin/AND
Begin/OR
d
e
f
End

---> Marker/AND

Begin/OR
g
h
i
End
End
End

the parentheses were set correctly in the resulting search expression. In
addition, when I opened the "Advanced query..." dialog in GroupWise, it
showed the distinct groups just as they were supposed to be.

Black and arcane art, indeed ;-)

Best regards,
Heinz