Categories > TinyButStrong general >

[val] not available everywhere

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: RwD
Date: 2005-03-01
Time: 09:51

[val] not available everywhere

For some reason I expected the following code to work: [section_side.section_DOM_id; if [val] != ''; then ' [val]']

Instead it turns out this is the way to do it:
[section_side.section_DOM_id; if [val] != ''; then ' [section_side.section_DOM_id]']

Is it for a specific reason that the [val] is not available in the then and else clauses? Would be sensible perhaps?
By: Skrol29
Date: 2005-03-01
Time: 19:18

Re: [val] not available everywhere

Hi RwD,

It works for me.
I've tested:
test: {[var.x; if [val] != ''; then ' [val]']}

With $x = '29';
By: RwD
Date: 2005-03-08
Time: 13:36

Re: [val] not available everywhere

My test is inside a block, not a single var. Is there perhaps a difference in that?
By: Skrol29
Date: 2005-03-08
Time: 13:52

Re: [val] not available everywhere

A block has no value. [var] is available only for Field parameters.
By: RwD
Date: 2005-03-08
Time: 15:03

Re: [val] not available everywhere

The code I posted in the start post is part of the block "section_side". the [val] does work in the if part...

hopefully that isn't a bug and you'll remove it :P
Instead I hope you add it to be avaiblable in the then part as well :)
By: RwD
Date: 2005-03-08
Time: 15:04

Re: [val] not available everywhere

(btw, don't mix up [var] and [val] ;))
By: Skrol29
Date: 2005-03-08
Time: 15:11

Re: [val] not available everywhere

Ok, sorry.
I wrote [var] but I meant [val].

Var fields and Block fields are merged using the same process.
So it should be no difference I'm quite sure.
But I'll check with an snippet.