Re: merging two tcl scripts
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: merging two tcl scripts

From: Gerry Snyder <gerry.snyder@comcast.net>
Date: Fri Dec 23 2005 - 17:36:32 CET

David N. Welton wrote:
> Jana wrote:
>
>>Dear all,
>>
>> I am jana from chennai, india. I need to merge two TCL scripts for my
>>academic project work.
>>
>> can someone help me?? i have the above two scripts with me..
>
>
> cat script1.tcl script2.tcl > newscript.tcl
>
> Or you could create a third script that loads the other two:
>
> #!/usr/bin/tclsh
>
> source script1.tcl
> source script2.tcl
>

In case the above suggestions do not meet your needs, e.g., if when you
say "merge" you mean that you need to intermingle rather than just run
consecutively, there is one thing you will need to look at carefully.

If the two scripts use the same names for procs and global variables
they could step on each other's toes, in which case you would need to
change the names so that they are distinct. On the other hand, you might
need to exchange information between the two scripts, which would
require having at least some of the names to be the same.

Doing this checkout will be complicated somewhat by the fact that Tcl
does not require explicit declaration of variables.

Good luck, and if you need more help please post again, and remember
that the more specific a question you ask, the more useful the answers
are likely to be.

Gerry
Received on Fri Dec 23 19:03:15 2005