Just for the record, I thought that my findings may be of some interest.

As you may all recall, I was trying to create a set of two-way communication pipes between two tasks. When both tasks were compiled with TURBO, this provided no problems. However, it seems impossible to get this to work between a Turbo compiled program and a Qliberated program (although I struggle from SuperBASIC as well), so any comments, suggestions or pointers where my code is wrong would be of the greatest help !!

We are talking of two simple tasks.
Task 1 (the main task), set up the pipes and Task 2 with the commands:

5 OPEN #1,'con'
100 OPEN #5,'pipe_100'
110 OPEN #4,'pipe_100'
120 CONNECT #4 TO #3: REMark Convert #4 to an input pipe
130 EXECUTE #5 TO 'win1_Double_exe' TO #4
140 TestVar=20
150 PRINT #5;TestVar
160 INPUT #3;Result
170 PRINT TestVar;' Doubled is: ';Result
180 PAUSE

Task 2 contains a simple few lines:
1 ChIN=30:ChOUT=31
10 REPeat loop
20 INPUT #ChIN;value
30 value=value*2
40 PRINT#ChOUT;value
50 END REPeat loop

Compile task 1 as win1_TEST_exe
Compile task 2 as win1_Double_exe (do not copy any windows in the compiler options).


This works fine under Turbo.

Now, try compiling the task 2 with QLiberator. You will need to amend line 1 to read:
1 ChIN=0:ChOUT=1


1) You get an error in task 2 - bad parameter at line 20
2) Try changing line 130 in task 1 to EX 'win1_Double_exe',#5,#4
- you again get bad parameter at line 20 in task 2
3) The Toolkit 2 documentation says that you can use an alternative syntax, so I tried altering line 130 in task 1 to:
EX #5 TO 'win1_Double_exe' TO #4
This seems to work as Double_exe is set up with an input and output pipe (looking in the channels menu of QPac2). However, I now get an error at line 160 in task 1 - end of file..
4) I tried using the Qliberator commands Q_PIPE instead of CONNECT (from Turbo Toolkit) and QX instead of EX. This gives similar results.


Even worse, is that there is a difference in the effects between running task 1 as a SuperBASIC program and running it as a compiled program.

1) If you run task 1 as a SuperBASIC program, you will be left with a pile of input pipes, EVEN after issuing the command CLOSE (even though task 2 no longer exists). Is this an oversight in the CLOSE command??
2) If you compiled task 1 (using Turbo) again the results differ dependent on the syntax used for EX. If you use EX 'win1_Double_exe',#5,#4
you get the bad parameter at line 20 in task 2. So try,
EX #5 TO 'win1_Double_exe' TO #4
This time, you still get end of file error at line 160 in task 1. However, have a look at the channle in Qpac2. Very odd this - you have managed to create an input pipe in task 1 (no output pipe ??) and an input pipe in Job 0 (presumably because win1_Double_exe is owned by Job 0 ??)


Hmm - just a though, not looked at what happens if both jobs are compiled with QLiberator....


Anyone know where I have gone wrong here?? There must surely be something simple.
I would appreciate it if people would actually try to do this and let us know if they find a solution (other than compiling both programs with Turbo).
--
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