After integration, I want to be able to run A's tcl command in B.
Assume I can only change A's code, is there any way to do this?
Hi,
if A and B are both Tcl scripts, then I'd refactor my application A to
be a library package with a namespace "::A" instead and also with an
exported main procedure like:
::A::run $args
Then, all that B is left to do, is to "require" package A and use it's
funtionality.
Cheers...
Shin
If you can't change B, how do you expect B to invoke A?
--
Glenn Jackman
Write a wise saying and your name will live forever. -- Anonymous
>
> After integration, I want to be able to run A's tcl command in B.
When you write an application, the way to run it, in another tcl
program, is to use exec or open "|..." to call the program.
If, instead of running program A, you want to run the same Tcl proc's
as A uses, but from B, then you have to rewrite A so all of its
functionality is available inside procs, then change B so that it uses
source or package require to get that code into B.
>
> Assume I can only change A's code, is there any way to do this?
If B happened to read a file of the user via source, then with some
work you can do it. If not, if B is a Tk program that you could "send"
commands to via the Tk send command, you might be able to go that
route.
If B is not written in a way to accept commands outside itself, then
you are pretty much going to be out of luck.