home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!elroy.jpl.nasa.gov!ames!agate!agate!adrianho
- From: adrianho@barkley.berkeley.edu (Adrian J Ho)
- Newsgroups: comp.lang.tcl
- Subject: Re: How do I imbed tcl in an application
- Date: 27 Jul 92 17:54:03
- Organization: University of California, Berkeley
- Lines: 29
- Message-ID: <ADRIANHO.92Jul27175403@barkley.berkeley.edu>
- References: <1992Jul27.175107.7633@rchland.ibm.com>
- NNTP-Posting-Host: barkley.berkeley.edu
- In-reply-to: shmdgljd@rchland.vnet.ibm.com's message of Mon, 27 Jul 1992 17:51:07 GMT
-
- In article <1992Jul27.175107.7633@rchland.ibm.com> shmdgljd@rchland.vnet.ibm.com (Jay Schmidgall) writes:
- >Does anyone have a document which describes some sort of cookbook approach
- >to imbedding tcl within an application, or just some tips/general how-to?
-
- A pretty good example is in the Tcl distribution itself: tclTest.c is
- a simple Tcl command-shell. If you don't have the distribution handy,
- let me know and I'll send it to you.
-
- A quick overview:
-
- >A) Tcl_CreateInterp()
- >B) a miracle occurs
- Tcl_CreateCommand(), Tcl_CreateCmdBuf(), Tcl_AssembleCmd()
- >C) Tcl_Eval()
- >D) Use the results (see B)
- Check the return value of Tcl_Eval() and interp->result, do your
- thing with them...
- >E) a miracle occurs.
- Loop back to (B)?
- >F) Tcl_DeleteInterp().
-
- Check the man pages for all the above functions -- it should be fairly
- clear how they work.
- --
- -----------------------------------------------------------------------------
- Adrian Ho, He With The Embarrassingly *Dead* Passion ** Phone: (510) 642-5563
- System Manager, CFD Lab, ME Dept, UC Berkeley * adrianho@barkley.berkeley.edu
- Maintainer, Tcl/Tk Contrib Archive ---- barkley.berkeley.edu [128.32.142.237]
- Send all Tcl/Tk Archive-related stuff to tcl-archive@barkley.berkeley.edu
-