On Wed, 15 Dec 2004 15:51:03 -0000, Rich Mellor <[EMAIL PROTECTED]> wrote:

On Wed, 15 Dec 2004 16:43:36 +0100, FranÃois Van Emelen <[EMAIL PROTECTED]> wrote:

Hi Rich,
You could try this:

100 rem ram1_test_bas
105 open#0,con_:cls#0
110 OPEN#4,'pipe_essai_100' :rem open named pipe
115 TestVar=2
120 PRINT #4;TestVar :rem send data to pipe
125 eX 'ram1_Double_bas',,#4 :rem or ex 'ram1_Double_obj',,#4 if qliberated
130 rem this works fine too: eX 'ram1_Double_bas' or ex 'ram1_Double_obj' if qliberated
135 rem open named pipe created in ram1_double_bas for input
140 open_in#3,pipe_retour :input#3,R
145 PRINT#0, testVar;' doubled =';R :rem close#4
150 PAUSE :rem pause should be avoided in compiled progs IIRC


100 rem ram1_double_bas
105 ChIN=0:ChOUT=1
110 open_in#chin,pipe_essai :rem open named pipe for input from test_bas
115 rem REPeat loop
120 INPUT #ChIN;value :rem fetch value in pipe
125 value=value*2 :r=value
130 open#ChOUT,pipe_retour:print#chout,r ::close#chout:stop
135 rem  END REPeat loop

I hope I understood correctly what you are(were) trying to achieve. If not sorry for the disturbance.
FranÃois Van Emelen


Not quite no - this is using named pipes - the EX, EXEUTE and QX commands all allow you to pass and set up the appropriate pipes and channels without needing named pipes.

Problem with named pipes is that there are several different variations, all of which use different syntax so you cannot rely on this for QDOS systems.


I also forgot to say - having spoken with George Gwilt the problem with using EX within a compiled program to create the pipes between jobs is that when it gets to the line


EX #5 TO 'win1_Double_exe' TO #4, or
EX 'win1_Double_exe',#5,#4, or
EX 'win1_Double_exe',,#4 (as above)

not only does it startup the job win1_Double_exe with Job 0 as its owner, but it also closes and re-opens #4. Unfortunately, it also gives #4 the new owner ID of Job 0 (and not the current job). This makes it impossible for the compiled program to get the information from #4 as it is looking at the WRONG channel for the return pipe.

--
Rich Mellor
RWAP Services
26 Oak Road, Shelfield, Walsall, West Midlands WS4 1RQ

http://www.rwapservices.co.uk/

_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to