On Aug 1, 2010, at 6:31 PM, Leandro Henrique Oliveira Fernandes wrote:

> It works for me. But what these format %(code ? '('+code+')' : '')  stand for?

In a format string, you can have %(EXPR), where EXPR is any "value expression".

Value expressions are a sub-language within Ledger, specific to Ledger, that
provide a simple expression language for evaluating values.  There will be a
whole chapter in the new manual dedicated to them.

Each valexpr has an "evaluation scope", which is like an implicit object
that gets referenced whenever an identifier is unknown at global scope.  In
the above example, "code" is implicitly read as "xact.code", which in a
register report is read as "post.xact.code".

The ?: syntax is the same ternary operator found in C.  I didn't think that
'' could be used to quote strings in valexpr syntax, but maybe I'm wrong. :)

John

Reply via email to