Categories > TinyButStrong general >

when to use var?

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Anonymous
Date: 2012-05-30
Time: 19:35

when to use var?

In the manual, there is a gray note under Automatic Fields that says:

"
Versioning:
- Automatic fields [onload] and [onshow] are supported since TBS version 3.2.0. For compatibility with versions prior to 3.2.0, remaining [var] fields are still merged as if there were [onshow] fields but is it recommended to use real [onshow] fields instead.
- [var] are processed into parameter then and else since TBS version 2.02.
"

Is it correct to say from this that 'var' is deprecated? If so, what is the best way to do the following where parent is assoc array and children is a tbs block:

[onshow;when [children.order]!=[var.parent.num_children];block=begin]
    this not the last child
[onshow;block=end]
By: Skrol29
Date: 2012-05-31
Time: 00:43

Re: when to use var?

Hi,


Only standalone 'var' fields are deprecated.
The normal usage is to embed them as in your example.

I realize the documentation is unclear.
I will update it.