home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxxmath.zip / rxxmathi.cmd < prev   
OS/2 REXX Batch file  |  1996-11-19  |  920b  |  38 lines

  1. /* REXX RXXMATH v1.3 (19 Nov 1996); Copyright 1992, 1996 by John Brock
  2.  
  3. RXXMATHI supports the interpretive REXX calculator function of RXXMATH,
  4. and should never be called directly.
  5.  
  6. Note that no REXX variables (other than "prompt") are ever set here.
  7. This means that when this program is used to create a "REXX shell" the
  8. interactive user cannot disrupt the function of the program by changing
  9. a variable that shouldn't be changed.
  10.  
  11. */
  12.  
  13. signal on halt
  14. signal on syntax
  15.  
  16. numeric digits arg(3)
  17.  
  18. if arg(1) \= ""
  19.   then interpret 'exit ('"RXXMATH"(arg(2) arg(3), "SCAN", arg(1))") + 0"
  20.  
  21. if arg(5, "E") then prompt = arg(5)
  22.  
  23. retry: if arg(1) \= "" then exit
  24.  
  25. do forever
  26.   interpret "RXXMATH"(arg(2) 0, "PULLSCAN", prompt, symbol("prompt"))
  27.   end
  28.  
  29.  
  30. halt: signal on halt
  31. say arg(4) errortext(4)
  32. signal retry
  33.  
  34.  
  35. syntax: signal on syntax
  36. if rc \= 44 then say arg(4) errortext(rc)
  37. signal retry
  38.