Re: call_back and routine_id

new topic     » goto parent     » topic index » view thread      » older message » newer message

noah smith wrote:
>I want to have two (or more) instances of ex.exe intrepreting scripts in
>which one instance can access functions intrepreted by the other.
>
>Is it possible to use call_back()/call_func()/call_proc() in one
>instance of ex.exe to call a function declared by routine_id() in
>another (assumming -- and i'm not sure this is possible, either), that
>the first instance could access the result of the routine_id() in the
>second instance?
>
>Basically, I want to be able to use functions in a second program which
>are declared after the beginning of run-time of my first program.

I'm not sure exactly what you're wanting, but it sounds like you could
make use of dynamic inclusion. Try this:

   1) Write program1.ex. Have the routines, variables, etc. you want
program2 to be able to access (if any) defined in something like
prog1.e. Program1 should "include prog1.e".

   2) Write program2.ex. Have the routines, etc. you want program1
to be able to access defined in prog2.e. Program2 should "include
prog2.e". If you want program2 to have access to any shared routines
from program1, be sure to have it "include prog1.e", probably first
thing. Both program2.ex and prog2.e can be written by program1 at
runtime, if desired.

   3) Have program1 run. If program1 is to write out program2.ex and
prog2.e, it should write them out before proceeding.

   4) Launch program2 from within program1 via the system() or
system_exec() routines.

   5) Have "include prog2.e" in the code of the first program. The
include can be after or before the launching of program2. Just be sure
to delay a few seconds before launching program2 (or hitting the include,
if launching is first.) This makes sure both programs don't attempt to
access prog2.e at the same time.

Hope this helps,


Rod

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu