-1

I have a Word template, where I go through a TBS block and dynamically display the values. Now I'd like to compare the actual value with the last value displayed. Is there any possibility to solve this in word?

I was thinking of setting a variable and save the last value in this variable. So I only have to compare my own variable with the actual value. But I cant figure out, whether this is possible or not. Any help or other suggestions?

Example

*[myblock;block=begin]
[myblock.entry] // here I want to check if its the same as the last entry
[myblock;block=end]*
Deduplicator
  • 44,692
  • 7
  • 66
  • 118
codeup
  • 21
  • 4

1 Answers1

0

TinyButStrong cannot do that in native.

But you can use parameter « ondata » and a PHP user function in order to add the previous value in the current record.

You can also use a method of an object (see TBS documentation)

PHP :

function f_ondata_user($BlockName, &$CurrRec, $RecNum) {
   static    $entry_prev = '';
   $CurrRec['entry_prev'] = $entry_prev;
   $entry_prev =    $CurrRec['entry'];
}

Template :

*[myblock;block=begin;ondata=f_ondata_user]
[myblock.entry]
[myblock.entry_prev]  // here I want to check if its the same as the last entry
[myblock;block=end]*
Skrol29
  • 5,402
  • 1
  • 20
  • 25