TCL conditional commands using ternary operator

Viewed 6334

is it possible to run conditional commands using TCL's ternary operator?

using if statement

   if {[string index $cVals $index]} {
       incr As
    } {
       incr Bs
    }

I would like to use ternary operator as follows but I get an error

invalid command name "1" while executing "[string index $cVals $index] ? incr As : incr Bs"

[string index $cVals $index] ? incr As : incr Bs
1 Answers
Related