home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 106 / EnigmaAmiga106CD.iso / www / afc / afc-dir / rexxer_examples.lha / Examples / Rexxer_Receiver.e < prev    next >
Text File  |  1997-09-07  |  838b  |  45 lines

  1. /*
  2.  
  3.    $VER: Rexxer Receiver Example 1.0
  4.  
  5.    Written By Fabio Rotondo
  6.  
  7.    (C)Copyright Amiga Foundation Classes
  8.  
  9.    NOTES: Run this program BEFORE Rexxer Sender.
  10.  
  11.           The Rexxer Receiver will handle messages
  12.           arriving from Rexxer Sender.
  13.  
  14.           Even if it is possible to run multiple instances
  15.           of this program, only the 'RECEIVE.1' port will
  16.           be addressed by Rexxer Sender, so be careful!
  17.  
  18. */
  19.  
  20. MODULE 'afc/rexxer', 'afc/explain_exception'
  21.  
  22. PROC main() HANDLE
  23.   DEF rx=NIL:PTR TO rexxer
  24.  
  25.   NEW rx.rexxer('RECEIVE')
  26.  
  27.   REPEAT
  28.     Wait(rx.sigbit())
  29.   UNTIL rx.get({parse})
  30.  
  31.   WriteF('Rexxer Receiver is terminating...\n')
  32.  
  33. EXCEPT DO
  34.   explain_exception()
  35.   END rx
  36.   CleanUp(0)
  37. ENDPROC
  38.  
  39. PROC parse(s, mes=NIL)
  40.   WriteF('Message arrived:\s\n', s)
  41.  
  42.   mes:=NIL
  43. ENDPROC StrCmp('QUIT', s), 0, 'Hello World!'
  44.  
  45.