madasafish
Technical User
I am very new to TCL but am very familiar with shell scripting and currently looking at a system that is using TCL. I want to use functions/procedures in the TCL script but keep getting an error message that it cannot find "ssName". This is the very first function there will be more and am looking to "plug" in the new function code where I have marked it "Plugin here -->". Firstly the code below errors (why?) and secondly is my logic correct for adding new sections of code in the proc and thirdly....is there a better way of doing it.
Thanks in advance,
Madasafish
Code:
proc CheckPopUpMsg $ssName {
if $ssName = "Pin_Protect_Res_704x480_51x655" {
# If there is an image match to the pin protect screen
# key in the pin
if { [lindex $ret 0] == 0 } {
# Press clear then key in pin
ecp_stbcontrol any down;
ecp_stbcontrol any left;
ecp_stbcontrol any ok;
ecp_stbcontrol any 1;
ecp_stbcontrol any 2;
ecp_stbcontrol any 3;
ecp_stbcontrol any 4;
ecp_stbcontrol any ok;
}
}
Plugin here --> if $ssName = xyz
}
# Main Prog
set channels [ecp_getchannels]
if {[llength $channels] == 0} {
return -code error "No channels assigned. Cannot proceed."
}
foreach channel $channels {
set ssName "Pin_Protect_Res_704x480_51x655"
CheckPopUpMsg $ssName #Call the function/procedure
set ret [ecp_imagecompare 1.0 1.0 $ssName]
......
......etc, etc