[TYPO3-english] calculation with values from register
Stefan Frömken
firma at sfroemken.de
Tue May 11 14:55:53 CEST 2010
Rob De Vries schrieb:
> Hello,
>
> I'm trying to do a very simple calculation with values i've added to the
> register :
>
> lib.output = COA
> lib.output {
> 20 = LOAD_REGISTER
> 20 {
> 20.numRows.table = tt_content
> 20.numRows.select.pidInList = this
> 20.numRows.select.where = tx_templavoila_ds = 2 AND deleted=0 AND
> hidden=0
>
> }
>
> 21 = LOAD_REGISTER
> 21 {
> 21.numRows.table = tt_content
> 21.numRows.select.pidInList = this
> 21.numRows.select.where = tx_templavoila_ds = 5 AND deleted=0 AND
> hidden=0
> }
>
> 22 = LOAD_REGISTER
> 22 {
> 22.numRows.table = tt_content
> 22.numRows.select.pidInList = this
> 22.numRows.select.where = tx_templavoila_ds = 6 AND deleted = 0 AND
> hidden=0
> }
>
> 40 = TEXT
> 40.value = {register:20}+{register:21}
> 40.insertData=1
> 40.prioriCalc = 1
> 40.wrap = <br />SUM=|
> }
>
> output: SUM=0
>
> I don't understand why the outpuy is 0
>
> register:20 = 1 and register:21 = 3 so the output need to be 4.
>
> any suggestions on what i'm doing wrong ?
>
> tnx
> Rob
I can't tell you how to made it the right way...I only can tell you why
it don't works:
You have forgotten the stdWrap-Order:
http://typo3.org/documentation/document-library/core-documentation/doc_core_tsref/4.3.1/view/1/5/
Quote: "stdWrap properties are executed in the order they appear in the
table below. If you want to study this further please refer to
typo3/sysext/cms/tslib/class.tslib_content.php, function stdWrap()."
So prioriCalc will be executed BEFORE insertData will be executed.
Stefan
More information about the TYPO3-english
mailing list