1. call_back and routine_id
I am having some conceptual difficulty with a project i am working on:
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.
thx
snortboy
2. Re: call_back and routine_id
Noah:
You must be using Windows because you can only have 1 instance running in
DOS. The best way would be to pass data back and forth through the clipboard
You can not use enviornment variable because the enviornment variables
between the exe is different. ( Euphoria does not use the real master
envionment ). If you use the clipboard you won't have worry about who put
the data there ( you can uses messages constants to tell which script
the data is for, etc ). There is information about how to use the clipboard
in the archive.
Bernie
3. Re: call_back and routine_id
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