16.02.2014 Views

Download - SoftMaker

Download - SoftMaker

Download - SoftMaker

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.

Here one function is applied to another. The function TODAY() returns the current<br />

date. But this result is immediately evaluated by the MONTH() function, which<br />

returns only the month of the date (as a number). So, on September 16, 2012 the<br />

formula would produce the value 9.<br />

Example: INT(B/1000)<br />

Here, the function INT, which converts a floating point number to an integer by<br />

removing its fractional part, is applied to the calculation B/1000. If B has the value<br />

3752.70, the formula gives the value 3.<br />

In summary, the arguments of functions can be other functions, any sorts of calculations,<br />

database fields, table cells references, or any combination of these.<br />

Variables<br />

The result of a formula can be assigned to a variable.<br />

Tip: All variables that are defined at a given moment appear in the Variable/Field<br />

list box in the dialog box for Insert > Calculation. You can insert any one of them<br />

in the formula by double clicking on it.<br />

Example: PRICE=17.99<br />

Here, the “formula” is just the constant value 17.99. The entry as a whole defines<br />

the variable PRICE and sets it to 17.99. Its value is valid from the position in the<br />

text at which you insert it to the end of the text – unless you assign another value to<br />

the PRICE variable farther down in the text.<br />

Note: Whenever you assign a value or a calculation to a variable, the value of the<br />

variable appears at the active position in the text. If you don’t want this – for<br />

example, because you only want to perform an intermediate calculation whose<br />

result should not be shown – enable the Hide result option in the dialog box for<br />

Insert > Calculation.<br />

Example: MY_MONTH=MONTH(TODAY())<br />

Here, the month of today’s data is calculated and shown. At the same time, the<br />

result is saved in the variable MY_MONTH.<br />

Naturally, you can insert such a variable in other formulas.<br />

Example: PRICE*1.19<br />

This formula gives the current value of the PRICE variable multiplied by 1.19.<br />

374 Calculations in the text Manual TextMaker

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

Saved successfully!

Ooh no, something went wrong!