|
Report Directives
Report directives are symbols that have special
meanings during report printing. They are used mainly to assist you
in neatly designing and then understanding your reports.
The first two report directives must be placed on
the very first column on each report. If this is not done, they are
treated as printable characters, not special codes. Report
directives include:
! Don't print this
line
* The entire line
is a comment
//
everything to the right (including
the double slash) is a comment.
Hidden lines are useful in allowing you to
perform a series of intermediate calculations before printing a
total. For example, if you wanted to calculate and show your
net profit, yet not show how this result
was arrived at, the ! command could be
used to suppress the display of the intermediate results. Consider
the example from the prior section, with modifications:
!
@add([period_amt:@sales], [period_amt:@otherincome],
&totalsales)
!
@subtract([&totalsales], [period_amt:@expenses],
&netprofit)
Your net profit is:
[&netprofit]
The first two lines are processed by CAPITAL, but
not printed. The third line is a comment or remark and is also
ignored. Only 'your net profit is:' and an amount will appear on
the report.
Comments are useful in allowing you to make notes
as to why a report was constructed in a certain way, as well as
making the report more readable. Comments,
however, are optional. Consider the above example again, with
further modifications:
*
-----------------------------------------------------------------
* the following section adds
total sales for the current period
* contained in the group @sales
to total sales for the
* @otherincome group. The result
is stored in &totalsales
*
-----------------------------------------------------------------
! @add([period_amt:@sales],
[period_amt:@otherincome], &totalsales)
*
-----------------------------------------------------------------
* total sales for the period
must now be subtracted from total
* overheads/expenses to arrive
at the net profit. This is stored
* in
&netprofit.
*
-----------------------------------------------------------------
! @subtract([&totalsales],
[period_amt:@expenses], &netprofit)
Your net profit is:
[&netprofit] // the result is printed here
In particular, note the difference between
* and //. If * is placed at
the left-most column of the report the entire line is treated as a
comment and it is completely ignored by CAPITAL. The second style
of comment, // is used to place remarks on
the same line as the instruction that is being executed. Everything
to the right of the first slash (including the
slash) is treated as a comment and not printed by CAPITAL.
_______________________
Related Topics:
The Report Writer/Editor
|