| miguel sofer 2005-10-27, 7:02 pm |
| My guess is: you are not having problems with calling the procedure,
but rather with variable scoping. Calling the procedure works fine, as
explained by suchenwi in his reply.
(What follows is written with the best intentions - it is not a rant by
any means. Happy to have newcomers!)
In order to help us help you, you should provide a small demo script
instead of saying "I tried writing ...", as there are too many ways in
which that could have failed. Notice how suchenwi did not just tell you
how to do it, but provided a small demo script?
We also need to know what happened exactly, rather than just "this does
not call ...". Is there an error return? What does it say?
Your message would have been much easier to understand if you had added
at the end (I'm inventing/guessing):
<guess>
What I did is:
% proc a {} {puts "This is proc a"}
% set procName a
a
% proc b {} {$procName}
% b
can't read "procName": no such variable
</guess>
Presented with this, we would know that the problem is with variable
scoping (there is no variable named procName within b's body, even
though there is a global variable by that name) and target our replies
accordingly.
HTH
Miguel
|