Controlling execution of auto-transacations

39 views
Skip to first unread message

Craig Earls

unread,
Nov 12, 2012, 4:32:27 PM11/12/12
to ledge...@googlegroups.com
John recently pointed out the auto xact are O(n) where are the number of transactions   I happen to have eleven, 9 of which are only useful when running one particular report (asset allocation).  Is there a way to specify values on the command line which could turn certain auto-xacts on or off?  I am thinking of two possibities:
1.  set a value on the command line that would be available for use in value expression and hence the expr of the auto-xact.  This doesn't really turn them OFF, just allows more flexibility
2.  Something similar to the C preprocessor #IFDEF structure where a block of input could be incorporated, or not, based on command line values.

--
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

thierry

unread,
Nov 12, 2012, 5:47:30 PM11/12/12
to ledge...@googlegroups.com
Hi,

Craig, I believe your suggestion could solve my "a few minutes ago" post about side effect of recent commit about automated transactions. Let's John give his views.

Thierry

John Wiegley

unread,
Nov 13, 2012, 1:12:23 AM11/13/12
to ledge...@googlegroups.com
>>>>> thierry <thierry....@free.fr> writes:

> 1. set a value on the command line that would be available for use in
> value expression and hence the expr of the auto-xact. This doesn't really
> turn them OFF, just allows more flexibility

This would be trivial to add, actually, but it would still result in
evaluating a value expression for every posting -- to test that provided
value. But it wouldn't evaluate as much of the expression each time.

> 2. Something similar to the C preprocessor #IFDEF structure where a block
> of input could be incorporated, or not, based on command line values.

Um, eww. :) But if that would really help people, something like an #ifdef
using value expressions would actually be quite easy.

John

Michael Gold

unread,
Nov 12, 2012, 11:09:01 PM11/12/12
to ledge...@googlegroups.com
On Mon, Nov 12, 2012 at 14:32:27 -0700, Craig Earls wrote:
> John recently pointed out the auto xact are O(n) where are the number
> of transactions I happen to have eleven, 9 of which are only useful when
> running one particular report (asset allocation). Is there a way to
> specify values on the command line which could turn certain auto-xacts on
> or off?

ledger seems to accept multiple --file arguments, so you could move the
asset-allocation transactions to a separate file and include it only
when running that report. Or you could use one file that sets up the
auto-transactions and pulls in your data with an 'include' command.

-- Michael
signature.asc

Craig Earls

unread,
Nov 13, 2012, 7:00:02 AM11/13/12
to ledge...@googlegroups.com
I never tried multiple --file arguments.  That might be the best wat to implement idea 2.
Reply all
Reply to author
Forward
0 new messages