home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 103 / af103b.adf / ARexx / no_port.rexx < prev    next >
OS/2 REXX Batch file  |  1997-08-28  |  445b  |  28 lines

  1. /* no_port.rexx - a syntax trap example... */
  2.  
  3. signal on syntax 
  4.  
  5. address 'somenonexistentport'
  6.  
  7. /* now try and send a command to the non-existent port... */
  8.  
  9. 'hello port'
  10.  
  11. quit:
  12.  
  13. exit /* end of main program */
  14.  
  15. syntax: 
  16.  
  17. if rc=13 then 
  18.  
  19.     do
  20.         say 'sorry - there is no port available called...'
  21.         say Address()
  22.         say 'you need to have the utility which sets up this port'
  23.         say 'up and running BEFORE you execute this script'
  24.     end
  25.  
  26. signal quit
  27.  
  28.