How to add reports into Gnucash
David T.
sunfish62 at yahoo.com
Thu Aug 20 13:23:29 EDT 2009
Indeed, a check using Dr. Scheme's syntax checker points to an error using the dot on a line that reads:
(lambda (op . args)
What I believe is the complete function reads:
(define (percentage-reporter)
(define (reporter min max)
(let ((min-% min) (max-% max) (index 0) (count 100))
(define (pct val)
(+ min-% (/ (* (- max-% min-%) val) count)))
(define (do-inc amount)
(gnc:report-percent-done (pct index))
(set! index (+ index amount))
(if (> index count) (set! index count)))
(define (do-get amount) ; returns a reporter over [index:index+amount)
(let ((old index))
(do-inc amount)
(reporter (pct old) (pct index))))
(define (do-for-each proc items)
(set! count (length items))
(for-each (if (= 1 (car (procedure-property proc 'arity)))
(lambda (item) (do-inc 1) (proc item))
(lambda (item) (proc item (do-get 1)))) items))
(lambda (op . args)
(case op
('odd (odd? index)) ; ugly hack!
('set-count (set! count (car args)))
('for-each (do-for-each (car args) (cadr args)))
('inc (do-inc (if (null? args) 1 (car args))))
('get (do-get (if (null? args) 1 (car args))))))))
(reporter 0 100))
I have read some Scheme documentation to try and figure this out, but could not understand what might be the problem here.
David
--- On Thu, 8/20/09, Derek Atkins <warlord at MIT.EDU> wrote:
> From: Derek Atkins <warlord at MIT.EDU>
> Subject: Re: How to add reports into Gnucash
> To: "David T." <sunfish62 at yahoo.com>
> Cc: "Users Gnucash" <gnucash-user at gnucash.org>
> Date: Thursday, August 20, 2009, 7:50 AM
> Sounds like a broken report.
>
> -derek
>
> "David T." <sunfish62 at yahoo.com>
> writes:
>
> > Derek--
> >
> > I changed config.user the way you mentioned, and had a
> very different result: gnucash completely crashed. I
> followed the instructions for getting a stack trace with
> gdb, but ended up with screens and screens of gnarly
> messages, none of which stood out to me. (I'm not at that
> computer right now, or I could give more details). Removing
> the load command from config.user restored GC functionality,
> so I suspect that the source report (which I copied from the
> list archives) is corrupt or out of date.
> >
> > Rather than continue to bug the list with this
> problem, I emailed the person who did the modifications on
> the Monthly Cash Flow report, but I have not heard anything
> back. Unfortunately, I have almost no programming skills
> whatsoever, so I don't even know how I can clear this up to
> try it out. Any suggestions would be welcome. I'd really
> like to figure out how to get this report working.
> >
> > David
More information about the gnucash-user
mailing list