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



vian1381@xxxxxxxxxxxx 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@xxxxxxxx Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|
.



Relevant Pages

  • ANN: AOLserver 4.5.0 released!
    ... On behalf of the AOLserver Team, I have the honor of announcing the ... AOLserver 4.5.0 is a major upgrade including several new Tcl commands, ... AOLserver is America Online's Open-Source web server. ... the "ns_zlib" command for compressing and uncompressing ...
    (comp.lang.tcl)
  • Tcl-URL! - weekly Tcl news and links (Mar 5)
    ... GRIDPLUS2 is a Tile based version of GRIDPLUS. ... *) New "gpselect" command to select a tablelist row or tree node. ... Some people take their license issues very personal indeed;-) (and ... Word documents via Tcl and tcom - ...
    (comp.lang.tcl)
  • Re: Core commands as ensembles...
    ... command that does much the same as [namespace code], ... TCL as their scripting/console engine. ... home-brew bits and pieces, in which I will use TCL in any way that I ...
    (comp.lang.tcl)
  • Re: is tcl a reasonable alternative to unix shell scripts?
    ... Tcl has a library of "common" functions and utilities known as "tcllib". ... That said, the Tcl core does contain *many* file related commands, most of which are collected under the "file" ensemble command. ... So, check out "file" and its many sub-commands in the standard Tcl man-pages for most of the built-in file support, and take a look at the "fileutil" module of tcllib for other higher-level file utilities. ...
    (comp.lang.tcl)
  • Re: Can Ruby read emails?
    ... command, and Ruby will read it and exacute that command. ... I actually wrote a system using Tcl some years back which used ... e-mail to "move" a software agent from one host to another. ...
    (comp.lang.ruby)