On Sun, 2002-02-03 at 09:18, Derek Atkins wrote: > I've been reading the query documentation but I don't > understand how one is supposed to use the existing APIs > to build a "complicated" query. > > For example, I want a query to be: > > a && (b || (c && d)) > > How would one use the QUERY_AND, QUERY_OR, etc. methods and > xaccQueryAddTerm() API to build a query of this logic? > > I guess my question is: what's the API to specify the "order of > logical operations", or how does one specify parens in a logical > expression?
To ensure grouping in a complicated expression, it's best to combine two simpler queries together with xaccQueryMerge. So you might create the query for c && d, and a query for 'b', and combine them, and then combine the resulting query with one for 'a'. dave
signature.asc
Description: This is a digitally signed message part