home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 12 / MA_Cover_12.iso / libs / rmh / examples / cx.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1999-05-24  |  647 b   |  33 lines

  1. /* */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4.  
  5. name   = "rmhCx"
  6. text   = "rmhCx 1.0 <alfier@iol.it>"
  7. descr  = "Cx in ARexx by rmh.library"
  8. hotkey = "rawkey control esc"
  9. cx=AddCx(name,text,descr,"UNIQUE NOTIFY",hotkey)
  10. if cx=0 then do
  11.     say "can't open cx because another istance is already there"
  12.     exit
  13. end
  14. cxs=CxSignal(cx)
  15.  
  16. say cxs
  17. do while 1
  18.     rsig=Wait(or(cxs,2**12))
  19.     if and(rsig,2**12)~=0 then exit
  20.     if and(rsig,cxs)~=0 then call handle(cx)
  21. end
  22. exit
  23.  
  24. handle:
  25. parse arg cx
  26.     handle.wait=0
  27.     num=HandleCx(cx,"HANDLE")
  28.     do i=0 to num-1
  29.         say pragma(id) i handle.i.class
  30.         if handle.i.class=="KILL" then exit
  31.     end
  32.     return
  33.