the shell complains about some names already existing. I'm then forced
to exit the shell, launch it again, and then source x.tcl again!
Is there a better way to re-source the corrected file in the same
session?
Thanks much.
If your sourced file only creates procs and does not create objects or
other things, you can resource as often as you like. Its only if you
create objects like widgets etc. that you cannot simply re-source the file.
Michael
> If your sourced file only creates procs and does not create objects or
> other things, you can resource as often as you like. Its only if you
> create objects like widgets etc. that you cannot simply re-source the file.
>
In addition, if the problem is existing widgets, you can enable a quick
re-source by adding the line, early in the script:
catch {eval destroy [winfo children .]}
You may use separate interpreters for each source command, while keeping
the process running.
interp create slave
slave eval source x.tcl
interp delete slave
# fix the bug if the source command returns an error, and repeat
Erik Leunissen
--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.
What is the exact error message, and what command produces it?
If it is [namespace import], then update to at least Tcl 8.4.12 where
this misfeature was corrected.
--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
The title says tkcon but it works for any console. I've been using
variants of it for almost 10 years.
Keith