home *** CD-ROM | disk | FTP | other *** search
- /* AREXX Program */
- /* I let you find out how to get out of this program
- easily.
- Answer at the end of the file (may not be really clean...)
- */
- LIBRARIES.exec = '00 00 00 00'x
- LIBRARIES.exec.OPENCOUNT = 0
- LIBS.exec.FindPort='FE7A'x||S||'200A'x
- LIBS.exec.AddPort='FE9E'x||A||'200A'x
- LIBS.exec.RemPort='FE98'x||A||'200A'x
- LIBS.exec.PutMsg='FE92'x||AA||'20090A'x
- LIBS.exec.GetMsg='FE8C'x||A||'2009'x
- LIBS.exec.ReplyMsg='FE86'x||A||'200A'x
- LIBS.exec.WaitPort='FE80'x||A||'2009'x
- LIBS.exec.AllocMem='FF3A'x||IA||'200102'x
- LIBS.exec.FreeMem='FF2E'x||AI||'200A01'x
- LIBS.exec.Wait='FEC2'x||A||'2001'x
-
- /* Note that we are going to mix AREXX support functions
- and rxgen functions
- */
- PORTNAME = 'TESTPORT'
- call GenOpenLib("exec",0)
- myport = GenACall("exec","FindPort",PORTNAME)
- if myport = NULL() then do
- theport = OPENPORT(PORTNAME)
- myport = GenACall("exec","FindPort",PORTNAME)
- sigbitraw = import(OFFSET(myport,15),1)
- sigbit = c2d(sigbitraw)
- say "Signal Bit:" sigbit
- if myport = NULL() then do
- say "Can't create port"
- exit 1
- end
- else do 10
- msg = GenACall("exec","Wait",bitset(NULL(),sigbit))
- say "Wait returned"
- do msgloop=0
- msg = GenACall("exec","GetMsg",myport)
- if msg = null() then leave msgloop
- call GenACall("exec","ReplyMsg",msg)
- end
- end
- end
- call GenCloseLib("exec")
- call CLOSEPORT(PORTNAME)
-
- /* did you find out ? */
- /* here you are:
- rx "do forever; address TESTPORT; end"
- */
-