01.12.2012 Views

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

7 Components: the Function Pages - Developers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

19.7.1<br />

Syntax<br />

The plugin is triggered by <strong>the</strong> variable %CALC{"..."}%. This<br />

variable can be situated within a table cell or in a normal continuous<br />

text, whereby several functions only make sense in connection with<br />

tables. The result of <strong>the</strong> function between <strong>the</strong> quotation marks is issued<br />

when <strong>the</strong> page is opened. For example, let us say you wish to<br />

calculate <strong>the</strong> average number of participants of three workshops visited<br />

by 14, 21 and 12 people respectively:<br />

%CALC{"$AVERAGE(14,21,12)"}%<br />

In <strong>the</strong> page view, <strong>the</strong> result 9 is displayed.<br />

Note: Calculations are always based on functions. Even an easy expression<br />

such as 1+1 must be expressed as a function:<br />

%CALC{"$EVAL(1+1)"}%.<br />

<strong>Function</strong>s have <strong>the</strong> following schematic structure:<br />

$FUNCTIONNAME(parameter)<br />

Its interpretation is done from left to right. It is possible to nest several<br />

functions, e.g.:<br />

%CALC{"$AVERAGE(14,21,$SUM(4,8))"}%<br />

whereby <strong>the</strong> calculation in this case is done from <strong>the</strong> innermost to<br />

<strong>the</strong> outermost function.<br />

The parameters of a function can be depicted as text, a ma<strong>the</strong>matical<br />

formula, a cell address or cell area. This depends on <strong>the</strong> function itself.<br />

So, for instance, <strong>the</strong> sum function processes concrete values or<br />

information in cell areas.<br />

If you wish to refer to <strong>the</strong> possibly changing content of fixed table<br />

cells, you can do so via <strong>the</strong> following coordinates:<br />

R1:C1 R1:C2 R1:C3 R1:C4<br />

R2:C1 R2:C2 R2:C3 R2:C4<br />

R3:C1 R3:C2 R3:C3 R3:C4<br />

The R stands for row and <strong>the</strong> C for column.<br />

19.7 Planning Costs and Financing with Tables<br />

(Spreadsheet Plugin)<br />

<strong>Function</strong>s<br />

Cell reference<br />

Fig. 19.12<br />

�<br />

�<br />

�<br />

299

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!