f



In Tcl and C++ code, how to use Tcl Command, such as exit?

In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control
all input and output from Tcl, but i want to use some of Tcl' Commands,
such as, exit.

I used Tcl_Eval() then, but the Tcl command seem invisible in my code,
I typed a string in command prompt, such as "AAAAA", and Enter, got
nothing feedback.

How can i do to get these Tcl Commands work?

Thanx!

0
vian1381 (8)
8/20/2006 12:38:39 PM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

1 Replies
1334 Views

Similar Articles

[PageSpeed] 16

vian1381@china.com.cn wrote:
> In my code, i used Tcl_SetStdChannel(0, STDIN) and a thread to control
> all input and output from Tcl, but i want to use some of Tcl' Commands,
> such as, exit.
> 
> I used Tcl_Eval() then, but the Tcl command seem invisible in my code,
> I typed a string in command prompt, such as "AAAAA", and Enter, got
> nothing feedback.

Your questions are hard to understand, but they suggest that you
believe that setting a custom stdin channel will do some magic to
establsh a prompt/read/eval loop.  That is not the case.

> How can i do to get these Tcl Commands work?

Start with something that works, like the source code for tclsh,
and adapt to your needs.

Or post a followup and include more code examples to explain
what you're doing and how it doesn't do what you expect.

-- 
| Don Porter          Mathematical and Computational Sciences Division |
| donald.porter@nist.gov             Information Technology Laboratory |
| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|
0
dgp1 (946)
8/20/2006 6:17:32 PM
Reply: