On Mon, 30 Oct 2000, Sai Geetha M N wrote:

> Hi

Hello.

> I am very new to JACL and TCL itself.

Don't worry, it is all rather easy to learn.

> My aim is to be able to call a TCL Script in a Java Program. I have figured
> out that I use the tcl.lang.Interp class to create a new instance of the
> jacl interpreter and use its eval method to evaluate any of the tcl commands
> But I want to execute a tcl script from the new interpreter.
> Something equivalent to the Tcl_EvalFile(Interp interp, String filename)
> that is available with the C version of TCL.
> I find there is a command interp.evalFile(String filename). But this is

But, you are not calling interp.evalFile() you are just calling 
interp.eval(). If you want to just run the source command you
could also call interp.eval("source file.tcl").

> In short, I need to know how to pass a tcl script to a java program and run
> it? I may have parameters too that have to be pass to that tcl file
> executable.

You can't pass "parameters" to something like "source foo.tcl".
What you can do is set variables before you source the file.
For example, if you set argv and argv0 to something before
evaling the file, it would be like running the file from
the command line.

cheers
Mo DeJong
Red Hat Inc

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to