home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / 123rexx.zip / REXXMATH.CMD < prev    next >
OS/2 REXX Batch file  |  1992-12-21  |  2KB  |  28 lines

  1. /*****************************************************************************/
  2. /* Lotus 1-2-3 For OS/2 sample @function.                                               */
  3. /*                                                                                                   */
  4. /* @REXX("REXXMATH.CMD",op1,operator,op2)                                    */
  5. /*                                                                                                   */
  6. /* Returns the arithmetic result of applying 'operator' to 'op1' and 'op2'.  */
  7. /* Operator must be one of the REXX binary operators.                               */
  8. /*                                                                                                   */
  9. /* @REXX("REXXMATH.CMD logFileName",op1,operator,op2)                        */
  10. /*                                                                                                   */
  11. /* Writes any TRACE or SAY output to a log file named 'logFileName'.         */
  12. /*                                                                                                   */
  13. /* Copyright (c) 1991 Lotus Development Corporation.    This code is supplied  */
  14. /* on an 'as is' basis as an example only.  This code has only received      */
  15. /* informal testing by Lotus.  Permission is granted    to copy and modify      */
  16. /* this code to your heart's content.  No warrenties expressed or implied.   */
  17. /* Remember, your mileage may vary.  Let us know if you find support of REXX */
  18. /* by 1-2-3 useful.                                                                              */
  19. /*****************************************************************************/
  20. PARSE ARG op1, operator, op2
  21. IF op1 = "?" THEN SIGNAL Tell     /* give info if called with "?" as 1st arg */
  22. INTERPRET "result =" op1 operator op2
  23. RETURN result
  24.  
  25. Tell:                                                       /* return a brief description */
  26. RETURN '@REXX("REXXMATH.CMD",op1,operator,op2) ==> returns result of' ,
  27.     "applying the REXX operator to op1 and op2."
  28.