home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / comm / mail / ems / rexx / general.ems < prev    next >
Encoding:
Text File  |  1993-03-11  |  885 b   |  50 lines

  1. /* General.ems */
  2.  
  3. options results
  4. signal on error
  5. signal on syntax
  6.  
  7. parse arg ems_command ems_arguments
  8.  
  9. if( ~show( 'l', "ems_rexx.library" ) ) then
  10. do
  11.    if( ~addlib( "ems_rexx.library", 0, -30, 0 ) )then
  12.    do
  13.       say "Could not open ems_rexx.library"
  14.       exit 10
  15.    end
  16. end
  17.  
  18. i = ems_arguments; ems_arguments = ''
  19.  
  20. do while length( i ) ~= 0
  21.  
  22.    parse var i j ',' i
  23.  
  24.    j = strip( j, 'B' )
  25.  
  26.    if ems_arguments ~= '' then ems_arguments = ems_arguments' , "'j'"'
  27.    else                        ems_arguments =                 '"'j'"'
  28.  
  29. end
  30.  
  31. say "ret =" ems_command || "(" ems_arguments ")"
  32. interpret "ret =" ems_command || "(" ems_arguments ")"
  33.  
  34. say 'Result =' ret
  35.  
  36. call EMS_FreeScriptData()
  37. exit 0
  38.  
  39. error:
  40. syntax:
  41.  
  42. error_text = EMS_LastError()
  43.  
  44. if error_text = '' then error_text = rc ErrorText( rc )
  45.  
  46. say '| ***BREAK: error at' sigl error_text
  47.  
  48. call EMS_FreeScriptData()
  49. exit rc
  50.