Re: Exec under W2K (DOS)
From: Afri (amnon.friling_at_citicorp.com)
Date: 05/27/04
- Previous message: Bryan Oakley: "Re: Exec under W2K (DOS)"
- In reply to: Andreas Otto: "Re: Exec under W2K (DOS)"
- Next in thread: Cameron Laird: "Re: Exec under W2K (DOS)"
- Reply: Cameron Laird: "Re: Exec under W2K (DOS)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 27 May 2004 10:42:27 -0700
Andreas Otto <nospam@onlinehome.de> wrote in message news:<mtjgo1-5ca.ln1@linux02.otto-net>...
> Hi,
>
> you don't have to "exec" an additional tcl script ..
>
> the "interp" creates an independent tcl-interpreter in the same
> process:
>
> 1. set ITP [interp create]
> 2. interp eval $ITP source myscript.tcl
> 3. set result [interp eval $ITP my_main_proc my_arg_1 my_arg_2 ...]
> 4. interp delete $ITP
>
> puts everthing together in on tcl proc like
>
> proc my_syript_eval {script args} {
> set ITP [interp create]
> interp eval $ITP source $script
> set result [interp eval $ITP $args]
> interp delete $ITP
> return $result
> }
>
> and you are ready
>
>
> mfg
>
> aotto
Andreas
This looks very promising.
I am not familiar enough with interpreters so I have a few questions.
1. I had a problem with the line "interp eval $ITP source $script".
Is it required?
2. My needs will be better served if I could "compile" the external
script once and re-use it with different arguments later one. Is that
possible? Could you please provide sample code for that?
Gratefully
Afri
- Previous message: Bryan Oakley: "Re: Exec under W2K (DOS)"
- In reply to: Andreas Otto: "Re: Exec under W2K (DOS)"
- Next in thread: Cameron Laird: "Re: Exec under W2K (DOS)"
- Reply: Cameron Laird: "Re: Exec under W2K (DOS)"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|