On Monday 03 May 2004 7:44, Neil Williams wrote:
> On Sunday 02 May 2004 10:08, Derek Atkins wrote:
> > > I'm trying to understand QOF using the sourceforge example:
> > > http://qof.sourceforge.net/my-obj-example.c.html
>
> > To find the invoices you either need to iterate
> > (using qof_collection_foreach) to build the list, or you need to
> > build and run a Query.
> > No.  The invoices are all properly registered.  You're just not using
> > the right APIs to get at them.

I can't get this clear and I can't find any documentation on exactly how to 
iterate over the existing, registered, GnuCash objects. At the moment, QOF 
isn't make a whole lot of sense. Do I have to create and register yet another 
object to query the invoice object? If not, how do I access the foreach 
routine for GncInvoice?
Where's the documentation for using QOF and Gnucash together?

[EMAIL PROTECTED]:/opt/neil/gnucash/src/doc$ grep qof */*
[EMAIL PROTECTED]:/opt/neil/gnucash/src/doc$ grep QOF */*
[EMAIL PROTECTED]:/opt/neil/gnucash/src/doc$ cd ../../doc
[EMAIL PROTECTED]:/opt/neil/gnucash/doc$ grep QOF */*
[EMAIL PROTECTED]:/opt/neil/gnucash/doc$ grep qof */*

This little snippet:

        GncInvoice *firstinvoice = gncInvoiceCreate (testbook);
        gncInvoiceSetID(firstinvoice, "1001");
        GncInvoice *secondinvoice = gncInvoiceCreate (testbook);
        gncInvoiceSetID(secondinvoice, "2002");
        printf("Invoice ID: %s\n", gncInvoiceGetID(firstinvoice));
        QofCollection *coll = qof_book_get_collection (testbook, GNC_ID_INVOICE);
        printf("Coll data type: %s\n",qof_collection_get_type(coll));

produces:
[EMAIL PROTECTED]:/opt/neil/gnucash/src/import-export/gnc-book-merge$ ./gnc_book_merge
Invoice ID: 1001
Coll data type: gncInvoice

which is fine. What is needed to iterate over both invoices?

I'm not looking at queries today, I just want to get this iteration sorted out 
in my head (and therefore in the gnc_book_merge documentation).

-- 

Neil Williams
=============
http://www.codehelp.co.uk/
http://www.dclug.org.uk/
http://www.isbn.org.uk/
http://sourceforge.net/projects/isbnsearch/

http://www.biglumber.com/x/web?qs=0x8801094A28BCB3E3

Attachment: pgp00000.pgp
Description: signature

_______________________________________________
gnucash-devel mailing list
[EMAIL PROTECTED]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to