I’m looking for TCL code that supports multiple conditions within an IF statement. Something similar to a simple C IF statement, for example.
Like:
if ( (a == b) && (x == y || x != a) ) {
do something;
}
I can’t imagine this is a shortcoming of TCL, but I haven’t seen an example of this syntax thus far. Multiple braces or brackets haven’t worked either.
Thanks guys! This seemed like such a simple question, I knew it had to be “operator error”. I had tried the parentheses initially and couldn’t get it to work, and found no reference for grouping syntax for IF statements in my searching.
Your examples work just fine. My example was just a C example showing the desired groupings, I’m not actually using those evaluations.
Howdy Max! The nested ifs would be ok, but I’m trying to build an outgoing email string for errors and it would have resulted in building the string multiple times (for readability). I was just trying to make if a bit more elegant. But hey, whatever works, right? 🙂