I am trying to do alert the user if any 2 of the 4 counter variables is non-zero. What is the best way to code this without a long if else condition like this?
# Description: report violation if any 2 type of device counts is non-zero (mix of Vt cells)
if { $count_hvt >0 && ($count_lvt >0 || $count_ulvt>0 ||$count_svt >0 ) } {
return 1
} elseif { $count_lvt >0 && ($count_hvt >0 || $count_ulvt>0 ||$count_svt >0 ) } {
return 1
} elseif { $count_svt >0 && ($count_hvt >0 || $count_lvt>0 ||$count_ulvt >0 ) } {
return 1
} elseif { $count_ulvt >0 && ($count_hvt >0 || $count_lvt>0 ||$count_svt >0 ) } {
return 1
} else {
#puts "-0- return 0"
return 0
}