Categories > TinyButStrong general >

when with function

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: lotiara
Date: 2008-10-25
Time: 23:52

when with function

Hi everybody,
is there a way to use "when" with a boolean function ?, I mean:
now I use

[Blk.mival;block=tr;when [Blk.mival] != '123']

but it is to much simple some times.

How can I do this
function Evaluate($arg1, $arg2...)
{
   if ($arg1 > 100 && $arg1 <200)  && trim(arg2) == 'hi' return 1
  else return 0
}

[Blk.mival;block=tr;when Evaluate(Blk.mival,$myvar) == 1]

Thanks all.
Good Job.
By: TomH
Date: 2008-10-26
Time: 02:27

Re: when with function

(Sorry if double post.)

You might consider the ondata event function capability

It allows you to perform PHP processing to each block data before the merging takes place.

I find it very helpful for complex data, maybe it can help you too.

See the http://www.tinybutstrong.com/examples.php and look at "Event Functions" example.  ASke here some more if you need help with it.

Hope that helps,
TomH