Xref: utzoo comp.lang.rexx:450 comp.sys.amiga.programmer:2512 Newsgroups: comp.lang.rexx,comp.sys.amiga.programmer Path: utzoo!utgpu!cunews!bnrgate!bcrka451!cadnews From: vansickl@bcrka340.bnr.ca (Greg VanSickle 1561848) Subject: anomalous AREXX behaviour Message-ID: <1991Apr9.151344.21097@bnr.ca> Originator: vansickl@bcrka340 Sender: vansickl@bcrka340 Organization: Bell-Northern Research, Ottawa, Canada Distribution: na Date: Tue, 9 Apr 91 15:13:44 GMT While showing rexx to a freind I typed in the simple programme given in AC's Tech Amiga article on Interprocess Communication. It didn't work! The source for the two programmes are given below - note the two trace statements marked as T1 and T2, the symptoms depended heavily on them. Simple1 runs simple2, sends it 25 messages, then quits. Simple2 opens a port, waits for 25 messages, displays them, closes the port and quits: /* simple1.rexx */ trace r <---- T1 address command call addlib("rexxsupport.library",0, -30, 0) run rx simple2 call delay(300) address PORT do i = 1 to 50 by 2 i i i end exit /* simple2.rexx */ trace r <---- T2 call openport(PORT) call delay(500) do i = 1 to 50 by 2 call waitpkt(PORT) pkt = getpkt(PORT) say getarg(pkt) call reply(pkt) end call closeport(PORT) exit If T1 isn't included, and T2 is, then the program runs to completion as expected. However, if T2 is not included then I get the following sent to the consol: 1 1 1 3 3 3 5 5 5 7 7 7 Error 18 in line 8: Invalid argument to funtion +++ command returned 10 Command returned 10/18: Invalid argument to function +++ Error 13 in line 9: Host Environment not found bin:rexx/rx faiiled (return code 10) If T1 is included and T2 is not then I get a similar result but it fails on the first message, not the 5th. Question 1: 'address PORT' ... 'i i i' must build a packet and send it to the port PORT. Does the programme continue past the statement 'i i i' before the reply message is received? Question 2: I noticed that it's difficult to keep consol output separate when two rexx programmes are running. Does anyone know an easy way to keep the output from simple1 and simple2 separate ? Question 3: I make the following (but shakey) conclusion, is it correct? Between waitpkt and getpck in simple2, simple1 terminates, which means the reply port disappears, hence PORT is no longer a valid argument for getpkt. This implies the answer to question 1 is 'yes', ie. all 25 messages are sent regardless of the status of replies to any of them. If this is the case, the programme is fundamentally flawed. Question 4: How do you make this work? Thanks in advance. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Geg VanSickle Silicon Support Bell Northern Research phone: 613-763-5160 PO Box 3500 ESN: 393-5160 Nepean, Ontario, Canada K2H 8V4 cocos: Greg Van Sickle email: vansickl@bnr.ca --------------------------------------------------------------------- Vancouver van cu' ver n. where we should all be, as opposed to where I am =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=