I am learning TCL and wanted to know how can I find out errors in my code. I mean what line no is error happening or how can I debug it.
Following is the code which I am trying :
proc ldelete {list value}{
set ix [lsearch -exact $list $value]
if{$ix >=0}{
return [lreplace $list $ix $ix]
} else {
return $list
}
}
Following is the error i am getting :
extra characters after close-brace
I will appreciate the help.
Thanks
aditya
If you are running this thus:
tcl foo.tclthen you should be getting an error message telling you that the error is on line 1. (The problem is the lack of a space between the close brace and the open brace.)
As a general rule, if you are working interactively, useful messages (eg the stack trace) are often found in errorInfo, so this is often helpful:
% puts $errorInfo