Categories > TinyButStrong general >

Condition

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Tinmar
Date: 2005-03-24
Time: 23:06

Condition

Hi,

I need to do this :
if (var1 == true) {
  if (var2 == true) {
     echo "ok";
  }
}

Without doing this (because the var2 is not declared if var1 is false) :
if (var1 == true && var2 == true) {
echo "ok";
}

Thanks a lot
By: Skrol29
Date: 2005-03-25
Time: 19:54

Re: Condition

Hi Tinmar,

First I have to say that
  if (var1 == true && var2 == true)
Is available in Php even if var2 is not declared when var1 is false.
It's possible because Php doesn't evaluate next AND clauses when a false one is found.

For TBS it's different. There is no AND operator.
But you can do the following:
[onload;if [var.var1],[var.var2.noerr]='1,1';then 'ok';else '']
By: Tinmar
Date: 2005-03-25
Time: 20:02

Re: Condition

Oh yes that's right, the noerr parameter is working very well.

Thanks a lot for this answer !!!

Coding with TBS is a real pleasure, i just love it, very esay and powerfull.

Congratulation for your work on this project.

Tinmar (qui n'avait pas vu qu'il y avais une rubrique en francais ;))