Hi all,
I have a newbie question I am trying to assign a string to a variable in a conditional expression as follows
set range_a "5:4"
set range_b "3:2"
set range_c "1:0"
set range [expr ($i==0) ? $range_a : ($i==1) ? $range_b : $range_c]
I get the following error
unexpected operator ":" without preceding "?"
in expression "... ? 5:4 : (1==1) ? 3:2 : 1:0"
(parsing expression "(1==0) ? 5:4 : (1==1) ...")
invoked from within
"expr ($i==0) ? $range_a : ($i==1) ? $range_b : $range_c"
It is basically not treating range_a/range_b as strings - Could you please suggest a way to get this to work?
Thanks a lot in advance!
I have a newbie question I am trying to assign a string to a variable in a conditional expression as follows
set range_a "5:4"
set range_b "3:2"
set range_c "1:0"
set range [expr ($i==0) ? $range_a : ($i==1) ? $range_b : $range_c]
I get the following error
unexpected operator ":" without preceding "?"
in expression "... ? 5:4 : (1==1) ? 3:2 : 1:0"
(parsing expression "(1==0) ? 5:4 : (1==1) ...")
invoked from within
"expr ($i==0) ? $range_a : ($i==1) ? $range_b : $range_c"
It is basically not treating range_a/range_b as strings - Could you please suggest a way to get this to work?
Thanks a lot in advance!