got some problem. in my script i have several standard settings which can be overwritten by chan settings.
e.g. i have var vonend(standard), vonend(#mychan) and vonend(#anotherchan). now if vonend(#mychan) exists, the script should use vonend(#mychan), otherwise vonend(standard).
now to prevent an [info exists] every time i need a variable, i wrote a proc which should decide wheter chan setting or standard setting is taken.
here is what i got:
Code: Select all
proc avote:getValue {var value} {
if {[info exists $var($value)]} {
return $$var($value)
} else {
return $$var(standard)
}
}
Code: Select all
avote:getValue "vonend" "#mychan"
can anyone please correct my code?
and then ive got a question about the switch command.
ive got: if {x=="1" || x=="2"} {
what would that be in a switch command?