home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / arexx / misc_arexx / wgui-handler.rexx < prev    next >
OS/2 REXX Batch file  |  1997-03-30  |  2KB  |  103 lines

  1. /* GiGA-Handler v1.0 by Warp oh' GiGA Prod... Wed Sep 25 23:02:12 1996 
  2.  
  3. 1). Open 2-3 Shell windows.
  4. 2). Start the WGUI-Handler in one shell.
  5. 3). Start the WGUI-Connect in another shell.
  6.  
  7.  
  8. I just discovered that it might NOT work at the moment. But look at the code,
  9. and you'll be able to write your own handler...
  10.  
  11.  
  12. */
  13.  
  14.  
  15. Trace 'Off'
  16.  
  17. options results
  18.  
  19.  
  20.  
  21. if ~show('l','rexxsupport.library') then do
  22.    call addlib('rexxsupport.library',0,-30,0)
  23. end
  24.  
  25. If show('P','GIGA') = 1 then do
  26.     Say 'GiGA-Handler is already active...'
  27.     exit(0)
  28. end
  29.  
  30. if Openport('GIGA') ~= 1 then do
  31.     Say 'Error! - The Public message port, could not be opened...'
  32.     exit(10)
  33. end
  34.  
  35. call addlib "GIGA",-20
  36.  
  37. Calcount=0
  38. Resta:
  39.  
  40. Signal on HALT
  41.  
  42. QuitOK = 0
  43. do while QuitOK = 0
  44.     if waitpkt('GIGA') then do
  45.         packet=getpkt('GIGA')
  46.         
  47.         event=upper(getarg(packet,0))
  48.           Arg1=getarg(packet,1)
  49.           Arg2=getarg(packet,2)
  50.           Arg3=getarg(packet,3)
  51.  
  52.     say event arg1    
  53.  
  54. if Event='QUIT' then QuitOK=1
  55.  
  56.         if Event='POPREQ' then do
  57.     
  58.             Call Popreq(arg1,arg2)
  59.  
  60.             Say 'PopStr('Arg1')' 
  61.             Say 'Number of chars: ' Length(Arg1)'.' 
  62.             Calcount=Calcount+1
  63.             Say 'Access count: ' Calcount'.' 
  64.  
  65.         end
  66.     
  67.         
  68.     
  69.         call reply(packet,0)
  70.     end
  71.  
  72. end
  73.  
  74. Say 'OK! Are you happy now?  Im dead...'
  75. Exit(0)
  76.  
  77.  
  78.  
  79.  
  80. /* Funcs() starts here */
  81.  
  82.  
  83. Halt: 
  84.     Say "Sorry! I can't quit now! Warp won't let me!!!"
  85.     Signal Resta
  86. return 0
  87.  
  88.  
  89.  
  90.  
  91. PopReq: Parse arg MESS, USERNAME
  92.     s = 'Message from ' USERNAME
  93.     Call RTezrequest(MESS,'Done!',s,"rt_reqpos =reqpos_centerscr")
  94. return 0
  95.  
  96. /*
  97. **           ^- Pop a requester, with a message...   
  98. */
  99.  
  100.  
  101.  
  102.  
  103.