Variables in Scheduled Transactions?

Josh Sled jsled at
Wed Jan 5 15:00:08 EST 2005

On Sat, 2005-01-01 at 14:20, Robert Uhl wrote:
> How does one use variables in scheduled transactions?  I cannot seem to
> find anything in the docs except for tantalising references...

Sorry. I never really did write it up well, no.  At the same time,
there's not a whole lot there: basically just enough to barely support
the mortgage/loan druid ... and even that's not done very well.

I've been hoping to revist it and make it more powerful after the gnome2
port... but that's a ways off.

In any case, the documentation is basically as such:

1/ Any text string [not followed by parens] entered in the template 
   transaction will be recognized as a varible, and prompted for when 
   the scheduled transaction is to be created.

2/ Any text string followed by parens, optionally with arguments, will 
   have the string "gnc:" prepended to it and evaluated in the scheme 
   environment.  Arguments are seperated with ':'.  See fin.scm for 
   examples of providing functions.

> Ideally, I'd like to have a variable which decrements each month, in
> order to automatically calculate sum-of-digits depreciation.

There is a magic variable 'i', which stands for the current
instance-count of the scheduled transaction.  1 for the first, 2 for the
second, &c.  It might be 0-based.  In any case, if you know the starting
point, "(42 - i)" should work.


-- - `a=jsled;; echo ${a}@${b}`

More information about the gnucash-user mailing list