home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / viscobv6.zip / vac22os2 / ibmcobol / samples / toolkit / rexx / api / rexxcalc / memminus.cal < prev    next >
Text File  |  1996-11-19  |  811b  |  16 lines

  1. /* Rexx Calculator Memory Subtraction Key                            */
  2. parse arg memory, value                /* get the count of memories  */
  3. numeric digits CalcPrecision()         /* set current precision      */
  4. numeric form value CalcForm()          /* set current form           */
  5.  
  6. if \datatype(memory, 'Whole')          /* must be whole number       */
  7.   then return 'Error'                  /* return error indicator     */
  8.  
  9. if memory < 1 | memory >50             /* valid for counter          */
  10.   then return 'Error'                  /* return error indicator     */
  11.  
  12. memory = trunc(memory)                 /* get as an integer          */
  13.  
  14. 'GET' memory 'REGISTER'                /* get current value          */
  15. 'SET' memory register - value          /* store new value            */
  16.